Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Show HN: My current App Store Featured Game was written entirely in Scheme. Parent comment
((0 (73 84 92)) (1 (17 95 31)))
Where the 2 digit numbers are id numbers for the blocks. The single digit number to left of each row is the horizontal offset.
So, shifting a row, the most elementary operation in the game, just requires incrementing the offset.
Vertical shifts are done with a 90 degree rotation operation, then a horizontal shift, then a -90 degree rotation.
Sometimes traversing the lists is necessary, but the most common operations are fast, and then rest are fast enough.
The limiting factor in performance is definitely rendering, not the game logic.
There are no comments on this comment yet.
((0 (73 84 92)) (1 (17 95 31)))
Where the 2 digit numbers are id numbers for the blocks. The single digit number to left of each row is the horizontal offset.
So, shifting a row, the most elementary operation in the game, just requires incrementing the offset.
Vertical shifts are done with a 90 degree rotation operation, then a horizontal shift, then a -90 degree rotation.
Sometimes traversing the lists is necessary, but the most common operations are fast, and then rest are fast enough.
The limiting factor in performance is definitely rendering, not the game logic.