rock_paper_scissors 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -3
- data/lib/rock_paper_scissors/game_manager.rb +6 -5
- data/lib/rock_paper_scissors/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbce4cd4b86342bb2f8c743504575e3c28069bc8
|
4
|
+
data.tar.gz: ac5d654e1f95eb9d5bfcd0732222199f7e682ca2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8f0c36b69d19bb4e5300328f4941d49990a5f03a3616698e842b55e77fb767c7abeb25777faf557df6833b05f7e475de5aa7948d87e5a1779e987eb459bff4f
|
7
|
+
data.tar.gz: 5376045911f4f79eaa6bcc7e9d0c55b3aa6d5d9a842a00cb34140591734623a5ed7539d6e92217218f4ddb68ec208fc5e0700540637b6a5f281acc2b2a2503dc
|
data/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
Settle any argument with an epic Rock Paper Scissors battle. This gem allows you to run a 1 or 2 player rock paper scissors game from your command line.
|
4
4
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
5
|
## Installation
|
8
6
|
|
9
7
|
Add this line to your application's Gemfile:
|
@@ -38,4 +36,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/siakar
|
|
38
36
|
## License
|
39
37
|
|
40
38
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
@@ -18,23 +18,24 @@ module RockPaperScissors
|
|
18
18
|
@player1.select_move
|
19
19
|
@player2.select_move
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
break if quit?
|
21
|
+
break if winner
|
24
22
|
end
|
23
|
+
|
24
|
+
play unless quit?
|
25
25
|
end
|
26
26
|
|
27
27
|
private
|
28
28
|
|
29
|
-
def
|
29
|
+
def winner
|
30
30
|
puts "\n\n"
|
31
31
|
if @player1.move == @player2.move
|
32
32
|
puts "It's a draw! Let's try again!"
|
33
|
-
play
|
34
33
|
elsif player1_win?
|
35
34
|
puts "#{@player1.name} WINS with #{@@move_lookup[@player1.move].upcase} beating #{@player2.name}'s #{@@move_lookup[@player2.move].upcase}!"
|
35
|
+
true
|
36
36
|
else
|
37
37
|
puts "#{@player2.name} WINS with #{@@move_lookup[@player2.move].upcase} beating #{@player1.name}'s #{@@move_lookup[@player1.move].upcase}."
|
38
|
+
true
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|