PlayRockPaperScissorsGame 1.7.9 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/PlayRockPaperScissorsGame +6 -6
- data/bin/rps +6 -6
- data/lib/rps.rb +6 -6
- data/rps.gemspec +2 -2
- data/test/test_rps.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 109a6b2767cd1ae08407479878d93ed787d5246c
|
4
|
+
data.tar.gz: 46925f807c6c747ed7017dafec45768ceb18b1e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f5969f24d8ea16e5a0bb53e0d30314334d7937362a70addeee82c9516b57ff1c35fef484002cef2020919d3a1e9b191ef7ad748cc8e14a1dbba6398d9750ead
|
7
|
+
data.tar.gz: 314f52c990a422bc5fb4a47fbd08b0af1760c47c9301efe7b643584c5e3ee892a2e6715fcac8de90ebd024dc62a2a11a8ebcb9a01381849d73a85aa5d6276718
|
@@ -39,12 +39,12 @@ class PlayRockPaperScissorsGame
|
|
39
39
|
end;
|
40
40
|
def play(winning_score)
|
41
41
|
while @player_score < winning_score && @computer_score < winning_score
|
42
|
-
puts ColorizedString["Player score: #{@player_score}, "].colorize(:
|
43
|
-
ColorizedString["Computer score: #{@computer_score}, Ties: #{@ties}"].colorize(:
|
42
|
+
puts ColorizedString["Player score: #{@player_score}, "].colorize(:blue) +
|
43
|
+
ColorizedString["Computer score: #{@computer_score}, Ties: #{@ties}"].colorize(:blue);
|
44
44
|
player = PrivateMethods.player_choice;
|
45
45
|
computer = Constants::COMPUTER_CHOICES.sample;
|
46
|
-
puts ColorizedString["\nPlayer chooses #{player.to_s.downcase}"].colorize(:
|
47
|
-
puts ColorizedString["Computer chooses #{computer.to_s.downcase}"].colorize(:
|
46
|
+
puts ColorizedString["\nPlayer chooses #{player.to_s.downcase}"].colorize(:blue);
|
47
|
+
puts ColorizedString["Computer chooses #{computer.to_s.downcase}"].colorize(:blue);
|
48
48
|
case PrivateMethods.player_outcome [player, computer]
|
49
49
|
when :WIN
|
50
50
|
puts ColorizedString["#{player.to_s.capitalize} beats #{computer.to_s.downcase}, player wins the round"].colorize(:red);
|
@@ -57,8 +57,8 @@ class PlayRockPaperScissorsGame
|
|
57
57
|
@ties += 1;
|
58
58
|
end;
|
59
59
|
end;
|
60
|
-
puts ColorizedString["\nFinal score: player: #{@player_score}, "].colorize(:
|
61
|
-
ColorizedString["computer: #{@computer_score} (ties: #{@ties})"].colorize(:
|
60
|
+
puts ColorizedString["\nFinal score: player: #{@player_score}, "].colorize(:blue) +
|
61
|
+
ColorizedString["computer: #{@computer_score} (ties: #{@ties})"].colorize(:blue);
|
62
62
|
case PrivateMethods.final_outcome(@player_score, @computer_score)
|
63
63
|
when :WIN
|
64
64
|
puts ColorizedString["Player wins!"].colorize(:red);
|
data/bin/rps
CHANGED
@@ -39,12 +39,12 @@ class PlayRockPaperScissorsGame
|
|
39
39
|
end;
|
40
40
|
def play(winning_score)
|
41
41
|
while @player_score < winning_score && @computer_score < winning_score
|
42
|
-
puts ColorizedString["Player score: #{@player_score}, "].colorize(:
|
43
|
-
ColorizedString["Computer score: #{@computer_score}, Ties: #{@ties}"].colorize(:
|
42
|
+
puts ColorizedString["Player score: #{@player_score}, "].colorize(:blue) +
|
43
|
+
ColorizedString["Computer score: #{@computer_score}, Ties: #{@ties}"].colorize(:blue);
|
44
44
|
player = PrivateMethods.player_choice;
|
45
45
|
computer = Constants::COMPUTER_CHOICES.sample;
|
46
|
-
puts ColorizedString["\nPlayer chooses #{player.to_s.downcase}"].colorize(:
|
47
|
-
puts ColorizedString["Computer chooses #{computer.to_s.downcase}"].colorize(:
|
46
|
+
puts ColorizedString["\nPlayer chooses #{player.to_s.downcase}"].colorize(:blue);
|
47
|
+
puts ColorizedString["Computer chooses #{computer.to_s.downcase}"].colorize(:blue);
|
48
48
|
case PrivateMethods.player_outcome [player, computer]
|
49
49
|
when :WIN
|
50
50
|
puts ColorizedString["#{player.to_s.capitalize} beats #{computer.to_s.downcase}, player wins the round"].colorize(:red);
|
@@ -57,8 +57,8 @@ class PlayRockPaperScissorsGame
|
|
57
57
|
@ties += 1;
|
58
58
|
end;
|
59
59
|
end;
|
60
|
-
puts ColorizedString["\nFinal score: player: #{@player_score}, "].colorize(:
|
61
|
-
ColorizedString["computer: #{@computer_score} (ties: #{@ties})"].colorize(:
|
60
|
+
puts ColorizedString["\nFinal score: player: #{@player_score}, "].colorize(:blue) +
|
61
|
+
ColorizedString["computer: #{@computer_score} (ties: #{@ties})"].colorize(:blue);
|
62
62
|
case PrivateMethods.final_outcome(@player_score, @computer_score)
|
63
63
|
when :WIN
|
64
64
|
puts ColorizedString["Player wins!"].colorize(:red);
|
data/lib/rps.rb
CHANGED
@@ -28,12 +28,12 @@ class PlayRockPaperScissorsGame
|
|
28
28
|
end;
|
29
29
|
def play(winning_score)
|
30
30
|
while @player_score < winning_score && @computer_score < winning_score
|
31
|
-
puts ColorizedString["Player score: #{@player_score}, "].colorize(:
|
32
|
-
ColorizedString["Computer score: #{@computer_score}, Ties: #{@ties}"].colorize(:
|
31
|
+
puts ColorizedString["Player score: #{@player_score}, "].colorize(:blue) +
|
32
|
+
ColorizedString["Computer score: #{@computer_score}, Ties: #{@ties}"].colorize(:blue);
|
33
33
|
player = PrivateMethods.player_choice;
|
34
34
|
computer = Constants::COMPUTER_CHOICES.sample;
|
35
|
-
puts ColorizedString["\nPlayer chooses #{player.to_s.downcase}"].colorize(:
|
36
|
-
puts ColorizedString["Computer chooses #{computer.to_s.downcase}"].colorize(:
|
35
|
+
puts ColorizedString["\nPlayer chooses #{player.to_s.downcase}"].colorize(:blue);
|
36
|
+
puts ColorizedString["Computer chooses #{computer.to_s.downcase}"].colorize(:blue);
|
37
37
|
case PrivateMethods.player_outcome [player, computer]
|
38
38
|
when :WIN
|
39
39
|
puts ColorizedString["#{player.to_s.capitalize} beats #{computer.to_s.downcase}, player wins the round"].colorize(:red);
|
@@ -46,8 +46,8 @@ class PlayRockPaperScissorsGame
|
|
46
46
|
@ties += 1;
|
47
47
|
end;
|
48
48
|
end;
|
49
|
-
puts ColorizedString["\nFinal score: player: #{@player_score}, "].colorize(:
|
50
|
-
ColorizedString["computer: #{@computer_score} (ties: #{@ties})"].colorize(:
|
49
|
+
puts ColorizedString["\nFinal score: player: #{@player_score}, "].colorize(:blue) +
|
50
|
+
ColorizedString["computer: #{@computer_score} (ties: #{@ties})"].colorize(:blue);
|
51
51
|
case PrivateMethods.final_outcome(@player_score, @computer_score)
|
52
52
|
when :WIN
|
53
53
|
puts ColorizedString["Player wins!"].colorize(:red);
|
data/rps.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "PlayRockPaperScissorsGame"
|
3
|
-
spec.version = "1.
|
3
|
+
spec.version = "1.8.0"
|
4
4
|
spec.date = "2017-04-01"
|
5
5
|
spec.summary = "A Rock Paper Scissors Ruby Gem"
|
6
6
|
spec.description = "A Ruby-programmed rock paper scissors game. To install: gem install PlayRockPaperScissorsGame; To run: rps; or: PlayRockPaperScissorsGame; For issues: https://github.com/bag3318/RockPaperScissors/issues"
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.homepage = "https://rubygems.org/gems/PlayRockPaperScissorsGame/"
|
18
18
|
spec.extra_rdoc_files = "README.md"
|
19
19
|
spec.required_ruby_version = ">= 2.0.0"
|
20
|
-
spec.required_rubygems_version = ">= 2.6.
|
20
|
+
spec.required_rubygems_version = ">= 2.6.0"
|
21
21
|
spec.requirements << "A Windows or Mac computer."
|
22
22
|
spec.metadata = { "issue_tracker" => "https://github.com/bag3318/RockPaperScissors/issues", "source_code" => "https://github.com/bag3318/RockPaperScissors", "releases" => "https://github.com/bag3318/RockPaperScissors/releases" }
|
23
23
|
spec.post_install_message = "Thanks for installing! I hope you have fun playing rock paper scissors! :)"
|
data/test/test_rps.rb
CHANGED
@@ -35,12 +35,12 @@ class RakeTest
|
|
35
35
|
end;
|
36
36
|
def testPlay(winning_score)
|
37
37
|
while @player_score < winning_score && @computer_score < winning_score
|
38
|
-
puts ColorizedString["Player score: #{@player_score}, "].colorize(:
|
39
|
-
ColorizedString["Computer score: #{@computer_score}, Ties: #{@ties}"].colorize(:
|
38
|
+
puts ColorizedString["Player score: #{@player_score}, "].colorize(:blue) +
|
39
|
+
ColorizedString["Computer score: #{@computer_score}, Ties: #{@ties}"].colorize(:blue);
|
40
40
|
player = PrivateMethods.player_choice;
|
41
41
|
computer = Constants::COMPUTER_CHOICES.sample;
|
42
|
-
puts ColorizedString["\nPlayer chooses #{player.to_s.downcase}"].colorize(:
|
43
|
-
puts ColorizedString["Computer chooses #{computer.to_s.downcase}"].colorize(:
|
42
|
+
puts ColorizedString["\nPlayer chooses #{player.to_s.downcase}"].colorize(:blue);
|
43
|
+
puts ColorizedString["Computer chooses #{computer.to_s.downcase}"].colorize(:blue);
|
44
44
|
case PrivateMethods.player_outcome [player, computer]
|
45
45
|
when :WIN
|
46
46
|
puts ColorizedString["#{player.to_s.capitalize} beats #{computer.to_s.downcase}, player wins the round"].colorize(:red);
|
@@ -53,8 +53,8 @@ class RakeTest
|
|
53
53
|
@ties += 1;
|
54
54
|
end;
|
55
55
|
end;
|
56
|
-
puts ColorizedString["\nFinal score: player: #{@player_score}, "].colorize(:
|
57
|
-
ColorizedString["computer: #{@computer_score} (ties: #{@ties})"].colorize(:
|
56
|
+
puts ColorizedString["\nFinal score: player: #{@player_score}, "].colorize(:blue) +
|
57
|
+
ColorizedString["computer: #{@computer_score} (ties: #{@ties})"].colorize(:blue);
|
58
58
|
case PrivateMethods.final_outcome(@player_score, @computer_score)
|
59
59
|
when :WIN
|
60
60
|
puts ColorizedString["Player wins!"].colorize(:red);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: PlayRockPaperScissorsGame
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bag3318
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
requirements:
|
120
120
|
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 2.6.
|
122
|
+
version: 2.6.0
|
123
123
|
requirements:
|
124
124
|
- A Windows or Mac computer.
|
125
125
|
rubyforge_project:
|