chess_vwong 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb647ae34dfaa1eaa314c5ad0cf0701d0f0168c4
4
- data.tar.gz: 0228a61d3ca95cf530ee2a18e5d349f6a6af5c87
3
+ metadata.gz: 59e72ee60a254bdf61e9c3aceb8a27aae6282973
4
+ data.tar.gz: f858746d72427dc957308714023ff937d9a7adce
5
5
  SHA512:
6
- metadata.gz: c902df6af2f44d4c80cee1bb94876c874a0d11fa17e218e29efaf04d7acc8cab86cfbf60b940da679f68ac64d50c5748b5a4347e5ec2c7f0564e90fe4eee0a2f
7
- data.tar.gz: 91fdd57b4579d629b0f4caa6e0114830e843dc0b74226ea638ead07a51d3b09385f7d83f1e5e29d004d2d33b084f486f0c38400501ffbde5b6ec9c03f7206f53
6
+ metadata.gz: 0af0c8e153da96a860805a172909cfde289a81549d738053e160222f253c1cf84446538a4e8476aeb01274d4d224e493ac952b400a73457c282361d143ad902c
7
+ data.tar.gz: 304cebfd4fa136bb9da53bc223021ff40ce94552646c9bbecb24730a3f6065574b65333e302ffd24db4f8499927317ce7b20457441edd29a17c664cb3a42300d
data/README.md CHANGED
@@ -6,7 +6,7 @@ Although currently missing the feature that declares Check, it is completely pla
6
6
 
7
7
  TODO:
8
8
  1. Declare Check/Mate
9
- 2. En-Passant(first-turn) bug
9
+ 2. En-Passant(first-turn) restriction
10
10
 
11
11
  ##Gameplay
12
12
  The game is played on a standard 8x8 board as shown below.
@@ -30,7 +30,7 @@ If a command is invalid, the use will be alerted and prompted again until a vali
30
30
 
31
31
  ###Special moves
32
32
 
33
- All special moves in a chess game (castling, en passant, promotion, and a pawn's double step on its first move) are recognized and allowed during game play.
33
+ All special moves (castling, en passant, promotion, and a pawn's double step on its first move) are recognized and allowed.
34
34
 
35
35
  Note:
36
36
 
Binary file
@@ -80,14 +80,10 @@ module ChessVwong
80
80
  @node_path = []
81
81
  # DOWN
82
82
  if start[1] < dest[1]
83
- (start[1]...dest[1]).each do |i|
84
- node_path << grid[i][start[0]]
85
- end
83
+ (start[1]...dest[1]).each {|i| node_path << grid[i][start[0]] }
86
84
  # UP
87
85
  elsif start[1] > dest[1]
88
- start[1].step(dest[1] + 1, -1) do |i|
89
- node_path << grid[i][start[0]]
90
- end
86
+ start[1].step(dest[1] + 1, -1) {|i| node_path << grid[i][start[0]] }
91
87
  end
92
88
  node_path
93
89
  end
@@ -96,14 +92,10 @@ module ChessVwong
96
92
  @node_path = []
97
93
  # RIGHT
98
94
  if start[0] < dest[0]
99
- (start[0]...dest[0]).each do |i|
100
- node_path << grid[start[1]][i]
101
- end
95
+ (start[0]...dest[0]).each {|i| node_path << grid[start[1]][i] }
102
96
  # LEFT
103
97
  elsif start[0] > dest[0]
104
- start[0].step(dest[0] + 1, -1) do |i|
105
- node_path << grid[start[1]][i]
106
- end
98
+ start[0].step(dest[0] + 1, -1) {|i| node_path << grid[start[1]][i] }
107
99
  end
108
100
  node_path
109
101
  end
@@ -18,11 +18,11 @@ module ChessVwong
18
18
  # if there is a enemy piece nearby, then give option to attack
19
19
  def kill_move(node1, node2, moves)
20
20
  if color == 'w'
21
- moves << [-1, -1] if kill_conditions(node1, 'b') || ep_kill.first == "L"
22
- moves << [1, -1] if kill_conditions(node2, 'b') || ep_kill.first == "R"
21
+ moves << [-1, -1] if kill_conditions(node1, 'b') || ep_kill.include?("L")
22
+ moves << [1, -1] if kill_conditions(node2, 'b') || ep_kill.include?("R")
23
23
  else
24
- moves << [-1, 1] if kill_conditions(node1, 'w') || ep_kill.first == "L"
25
- moves << [1, 1] if kill_conditions(node1, 'w') || ep_kill.first == "R"
24
+ moves << [-1, 1] if kill_conditions(node1, 'w') || ep_kill.include?("L")
25
+ moves << [1, 1] if kill_conditions(node1, 'w') || ep_kill.include?("R")
26
26
  end
27
27
  end
28
28
 
@@ -1,3 +1,3 @@
1
1
  module ChessVwong
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chess_vwong
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Wong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-01 00:00:00.000000000 Z
11
+ date: 2015-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,7 +67,7 @@ files:
67
67
  - README.md
68
68
  - Rakefile
69
69
  - bin/chess_vwong
70
- - chess_vwong-0.0.1.gem
70
+ - chess_vwong-0.0.2.gem
71
71
  - chess_vwong.gemspec
72
72
  - example/example_game.rb
73
73
  - lib/chess_vwong.rb
Binary file