I hereby claim:
- I am uncompiled on github.
- I am uncompiled (https://keybase.io/uncompiled) on keybase.
- I have a public key ASDWgHhRDL5Jp-zAqlD-03CHp_wiod1ik17U_E-zq4xn5Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| {} |
| function gameOfLifeIterator(b) { | |
| const a = (x, y) => b[x] && b[x][y] | |
| return b.map((r, x) => | |
| r.map((_, y) => { | |
| let n = 0 | |
| a(x - 1, y - 1) && n++ | |
| a(x - 1, y) && n++ | |
| a(x - 1, y + 1) && n++ | |
| a(x, y - 1) && n++ | |
| a(x, y + 1) && n++ |
| function gameOfLifeIterator(b) { | |
| const a = (x, y) => b[x] && b[x][y] | |
| return b.map((r, x) => | |
| r.map((_, y) => { | |
| let n = 0 | |
| if (a(x - 1, y - 1)) n++ | |
| if (a(x - 1, y)) n++ | |
| if (a(x - 1, y + 1)) n++ | |
| if (a(x, y - 1)) n++ | |
| if (a(x, y + 1)) n++ |
| function gameOfLifeIterator(board) { | |
| const isAlive = (x, y) => board[x] && board[x][y] | |
| return board.map((row, x) => | |
| row.map((_, y) => { | |
| let n = getCellNeighborCount(x, y) | |
| return (isAlive(x, y) ? n > 1 && n < 4 : n === 3) ? 1 : 0 | |
| })) | |
| function getCellNeighborCount (x, y) { |
| return board.map((row, x) => | |
| row.map((_, y) => { | |
| let n = getCellNeighborCount(x, y) | |
| return (isAlive(x, y) ? n > 1 && n < 4 : n === 3) ? 1 : 0 | |
| }) | |
| ) |
| for (let i = 0; i < board.length; i++) { | |
| returnBoard[i] = [] | |
| for (let j = 0; j < board[i].length; j++) { | |
| let neighborCount = getCellNeighborCount(i, j) | |
| if (board[i][j] === 1) { | |
| if (neighborCount > 1 && neighborCount < 4) { | |
| returnBoard[i][j] = 1 | |
| } else { |
| function getCellNeighborCount (x, y, board) { | |
| let neighborCount = 0 | |
| if (isAlive(x - 1, y - 1)) neighborCount++ | |
| if (isAlive(x - 1, y)) neighborCount++ | |
| if (isAlive(x - 1, y + 1)) neighborCount++ | |
| if (isAlive(x, y - 1)) neighborCount++ | |
| if (isAlive(x, y + 1)) neighborCount++ | |
| if (isAlive(x + 1, y - 1)) neighborCount++ | |
| if (isAlive(x + 1, y)) neighborCount++ | |
| if (isAlive(x + 1, y + 1)) neighborCount++ |
| function gameOfLifeIterator(board) { | |
| let returnBoard = []; | |
| for (let i = 0; i < board.length; i++) { | |
| returnBoard[i] = []; | |
| for (let j = 0; j < board[i].length; j++) { | |
| let neighborCount = getCellNeighborCount(i, j, board); | |
| if (board[i][j] === 1) { |
| // This file includes the reasoning behind my manual minification choices. | |
| // I wouldn't write code like this for an actual project because if I | |
| // looked at this code in 2 months, I'd probably say WTF. | |
| function largestCommonSubstring(a, b) { | |
| // Use one declaration to minimize the number of let statements | |
| let l = 0, // Length of the longest common substring | |
| s = '', // Substring to return | |
| // Generate mxn array filled with zeroes | |
| // I would probably call this "lcs" in a real project, |