rubyknight 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/rubyknight +16 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/bin/rubyknight
CHANGED
@@ -47,6 +47,20 @@ def play b, eval
|
|
47
47
|
b.cnotation_move "#{RubyKnight::Board.position_to_coord move[0]}#{RubyKnight::Board.position_to_coord move[1]}"
|
48
48
|
end
|
49
49
|
|
50
|
+
def help
|
51
|
+
puts
|
52
|
+
puts "Enter a move such as e2e4, or a command."
|
53
|
+
puts "Commands are prefixed with !"
|
54
|
+
puts " !quit - quit"
|
55
|
+
puts " !undo - revert a move"
|
56
|
+
puts " !load <file> - load game state from a file"
|
57
|
+
puts " !dump <file> - dump game state to a file"
|
58
|
+
puts " !play - tell the computer to start playing the current color"
|
59
|
+
puts " !reset - start a new game"
|
60
|
+
puts
|
61
|
+
end
|
62
|
+
|
63
|
+
help
|
50
64
|
cplay = false
|
51
65
|
b = RubyKnight::Board.new
|
52
66
|
eval = RubyKnight::BoardEvaluator.new b
|
@@ -72,6 +86,8 @@ $stdin.each do |move|
|
|
72
86
|
when "reset"
|
73
87
|
b = RubyKnight::Board.new
|
74
88
|
eval = RubyKnight::BoardEvaluator.new b
|
89
|
+
when "help"
|
90
|
+
help
|
75
91
|
end
|
76
92
|
displayb b,eval
|
77
93
|
else
|