Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def make_move board, width, height, currentXPos, currentYPos, newColor, originalColor
- board[currentXPos][currentYPos] = newColor
- if currentXPos < height-2
- puts currentXPos
- puts height
- if board[currentXPos+1][currentYPos] == originalColor
- make_move board, width, height, currentXPos+1, currentYPos, newColor, originalColor
- end
- end
- if currentYPos < width-2
- if board[currentXPos][currentYPos+1] == originalColor
- make_move board, width, height, currentXPos, currentYPos+1, newColor, originalColor
- end
- end
- if currentXPos < height-2 || currentYPos < width-2
- if board[currentXPos+1][currentYPos] == originalColor
- make_move board, width, height, currentXPos+1, currentYPos+1, newColor, originalColor
- end
- end
- return board
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement