From df9286a0e1cef776e6117987623987f7cbf132c7 Mon Sep 17 00:00:00 2001 From: Tom Oedo Date: Mon, 20 Feb 2012 13:21:38 +0000 Subject: [PATCH] Added undo support for the GNU Shogi engine --- lib/plugins/engines/gnushogi.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/plugins/engines/gnushogi.rb b/lib/plugins/engines/gnushogi.rb index ceb0b3c..49f2422 100644 --- a/lib/plugins/engines/gnushogi.rb +++ b/lib/plugins/engines/gnushogi.rb @@ -47,4 +47,11 @@ class GNUShogiEngine < Engine send_command "quit" @engine.kill end + + def allow_undo?(player, manager) + # gnushogi waits when you tell it to undo + send_command "undo" + send_command "undo" + manager.undo(self, 2) + end end -- 2.11.4.GIT