Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. def make_move board, width, height, currentXPos, currentYPos, newColor, originalColor
  2. board[currentXPos][currentYPos] = newColor
  3.  
  4. if currentXPos < height-2
  5. puts currentXPos
  6. puts height
  7. if board[currentXPos+1][currentYPos] == originalColor
  8. make_move board, width, height, currentXPos+1, currentYPos, newColor, originalColor
  9. end
  10. end
  11. if currentYPos < width-2
  12. if board[currentXPos][currentYPos+1] == originalColor
  13. make_move board, width, height, currentXPos, currentYPos+1, newColor, originalColor
  14. end
  15. end
  16. if currentXPos < height-2 || currentYPos < width-2
  17. if board[currentXPos+1][currentYPos] == originalColor
  18. make_move board, width, height, currentXPos+1, currentYPos+1, newColor, originalColor
  19. end
  20. end
  21.  
  22. return board
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement