Closed dsaito closed 8 years ago
You can use rollback!
http://pioz.github.com/chess/classes/Chess/CGame.html#method-i-rollback-21
I tried the rollback! method, but it clears all moves from moves and coord_moves. That means it is taking back all moves. I don't know what I'm doing wrong here...
Can you show me the code?
Il giorno 23 mar 2016, alle ore 01:56, dsaito notifications@github.com ha scritto:
I tried the rollback! method, but it clears all moves from moves and coord_moves. That means it is taking back all moves. I don't know what I'm doing wrong here...
— You are receiving this because you commented. Reply to this email directly or view it on GitHub
I feel silly now. I had reset the game object (g = Chess::Game.new) prior to applying the rollback! method. I simply forgot to remove this line of code from my previous script editing. That explains the clearing of the move array. Everything works perfectly now, thanks.
Dear Enrico, how can I take back a move?