Skip to content

Instantly share code, notes, and snippets.

@jdwyah
Created August 31, 2013 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdwyah/6395411 to your computer and use it in GitHub Desktop.
Save jdwyah/6395411 to your computer and use it in GitHub Desktop.
def move(curMonte, space, moves, doubles)
dieOne = rand(6) + 1
dieTwo = rand(6) + 1
doubles += 1 if dieOne == dieTwo
nextSpace = (space + dieOne + dieTwo) % NUM_SQUARES
SQUARES[curMonte][nextSpace] += 1
if moves > 1
move(curMonte, nextSpace, moves - 1, doubles)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment