Skip to content

Instantly share code, notes, and snippets.

def coord_equal(a, b)
a[:x] === b[:x] && a[:y] === b[:y]
end
def move(state)
head = state[:you][:body][0]
neck = state[:you][:body][1]
moves = ['up', 'down', 'left', 'right']
moves.each do |move|
coord = move_as_coord(move, head)
if !off_board(state, coord) && !coord_equal(coord, neck)
return { move: move }
end
+---------+ +--------+ +-----------+ +-------------+
| Tooling | | GitHub | | 3rd Party | | Your Server |
+---------+ +--------+ +-----------+ +-------------+
| | | |
| Create Deployment | | |
|--------------------->| | |
| | | |
| Deployment Created | | |
|<---------------------| | |
| | | |
// Place your key bindings in this file to override the defaults
[
// New file uses cmd+n and a new folder uses cmd+shift+n (or ctrl).
{
"key": "cmd+n",
"command": "explorer.newFile",
"when": "explorerViewletFocus"
},
{
"key": "cmd+enter",