Skip to content

Instantly share code, notes, and snippets.

@aeharding
Last active August 29, 2015 13:57
Show Gist options
  • Save aeharding/9542320 to your computer and use it in GitHub Desktop.
Save aeharding/9542320 to your computer and use it in GitHub Desktop.
Diagonal star on dinamic grid thingy
diagDir = false
x = 5
y = 9
console.clear()
# Initialize that shizzle
grid = []
for i in [0...10]
grid.push []
for j in [0...10]
grid[i].push '-'
# Mark that shizzle
while grid[x]?[y]?
grid[x][y] = '*'
if diagDir
x++
y++
else
x--
y--
# Output that shizzle
out = ''
for i in [0...grid.length]
out += grid[i].join(' ') + '\n'
console.log out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment