{{ message }}

Instantly share code, notes, and snippets.

# Joshua Jungjoshjung

Created Dec 17, 2018
View 2048 Web Game Class
 window.Game2048 = function () { this.cells = []; this.boardValues = [ [0, 0, 0, 0], [2, 0, 0, 0], [0, 0, 0, 0], [0, 2, 0, 0]]; this.board = [[{}, {}, {}, {}], [{}, {}, {}, {}],
Created Dec 17, 2018
View 2048 Problem Solving
 /** * In the game 2048, the board consists of a 2-dimensional array of values. * * Every tile will always be a power of 2, starting with 2. * * The player can swipe left, up, right, or down. When this happens the numbers * "collapse" in that direction. Duplicate values merge into a single tile and * after swiping all non-zero values should have shifted in that direction. * * NOTE! A maximum of 2 tiles can merge at a time! So if you have a row of [4, 4, 2, 2]
Created Nov 15, 2017
View gist:6675c6963f3a9c782bfe49fc9f4a63b6
 import DebugInspector from 'ringa-fw-react/src/components/debugInspector/DebugInspector'; import Theme from 'ringa-fw-react/src/components/containers/Theme'; ... render() { return {this.props.children} // The rest of your application... ; }
Created Nov 14, 2017