2048: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,633:
fun shiftCellsLeft(grid: Array<Array<Int>>): Array<Array<Int>> =
grid.map { row ->
fun shiftCellsRight(grid: Array<Array<Int>>): Array<Array<Int>> =
grid.map { row ->
fun shiftCellsUp(grid: Array<Array<Int>>): Array<Array<Int>> {
Line 1,649:
rows.map { row ->
}.forEachIndexed { rowIdx, row ->
updatedGrid[0][rowIdx] = row[0]
Line 1,671:
rows.map { row ->
}.forEachIndexed { rowIdx, row ->
updatedGrid[3][rowIdx] = row[0]
Line 1,682:
}
fun
fun merge(row: Array<Int>, idxToMatch: Int = 0, idxToCompare: Int = 1): Array<Int> {
|