PlayRockPaperScissorsGame 2.3.9 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/docs/Code.md +8 -9
- data/docs/_site/CODE_OF_CONDUCT.html +1 -1
- data/docs/_site/CONTRIBUTING.html +1 -1
- data/docs/_site/Code.html +8 -9
- data/docs/_site/How_to_Build.html +1 -1
- data/docs/_site/Testing.html +1 -1
- data/docs/_site/index.html +1 -1
- data/lib/Constants.rb +3 -3
- data/lib/rps/version.rb +1 -1
- data/rps.gemspec +1 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78bf8c09ea90185dc255a22beed8d25a2b57f9af
|
4
|
+
data.tar.gz: 68844fc512004f60ea5a08198cb0a8b8e5a1975f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb0a377db9ce29649b72de91fd988cc22ccba2b105ad752554fe4ab550cd8eeb01711e4604f5982641c34324b61280c3d8fcca4a02ebf635a658a88243ca11f6
|
7
|
+
data.tar.gz: ce88df6496da5e83df0d319d7d1f9fd5d0cb3fbfd2f2b6d449e3ad92a8890973635d37a60e720c97ec9ea72f1fc7503563a02debc04f63cc990dffff4d7c2e98
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/docs/Code.md
CHANGED
@@ -21,16 +21,16 @@ title: Master Code - Play Rock Paper Scissors Game
|
|
21
21
|
=end
|
22
22
|
|
23
23
|
|
24
|
-
class PlayRockPaperScissorsGame
|
24
|
+
class PlayRockPaperScissorsGame # define master class
|
25
25
|
|
26
26
|
module RockPaperScissors
|
27
|
-
VERSION = "2.
|
27
|
+
VERSION = "2.4.0" # define version constant
|
28
28
|
end
|
29
29
|
|
30
30
|
# intiate the colorize gem
|
31
31
|
require "colorized_string"
|
32
|
-
ColorizedString.colors
|
33
|
-
ColorizedString.modes
|
32
|
+
ColorizedString.colors # colors; ex: red, green, blue
|
33
|
+
ColorizedString.modes # modes; ex: bold, italic, underline
|
34
34
|
|
35
35
|
module Constants
|
36
36
|
NTRY_TO_SYM = { # define constants from an entry to a symbol class
|
@@ -46,7 +46,7 @@ class PlayRockPaperScissorsGame
|
|
46
46
|
[:PAPER, :ROCK],
|
47
47
|
[:ROCK, :SCISSORS]
|
48
48
|
]
|
49
|
-
LOSERS = WINNERS.map { |
|
49
|
+
LOSERS = WINNERS.map { |wp,lp| [lp,wp] } # this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
|
50
50
|
INIT_STRINGS = [
|
51
51
|
ColorizedString["You are about to enter a rock-paper-scissors best of 3 match."].colorize(:green),
|
52
52
|
ColorizedString["Press the return/enter key to continue..."].colorize(:green),
|
@@ -139,12 +139,11 @@ class PlayRockPaperScissorsGame
|
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
142
|
-
private_methods :PrivateMethods
|
142
|
+
private_methods :PrivateMethods # make the PrivateMethods module private
|
143
143
|
|
144
144
|
end
|
145
145
|
|
146
|
-
PlayRockPaperScissorsGame.new.play(2) # call the play method and pass in 3 for the winning score
|
147
|
-
|
146
|
+
PlayRockPaperScissorsGame.new.play(2) # call the play method and pass in 3 (0, 1, 2) for the winning score
|
148
147
|
```
|
149
148
|
|
150
149
|
---------
|
@@ -153,4 +152,4 @@ PlayRockPaperScissorsGame.new.play(2) # call the play method and pass in 3 for t
|
|
153
152
|
|
154
153
|
[Home](./) | [How to Test](Testing) | [How to Build](How_to_Build) | [Contributing](CONTRIBUTING) | [Code of Conduct](CODE_OF_CONDUCT)
|
155
154
|
|
156
|
-
[//]: # (end markdown)
|
155
|
+
[//]: # (end markdown)
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
8
|
<meta name="theme-color" content="#157878">
|
9
9
|
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
|
10
|
-
<link rel="stylesheet" href="/assets/css/style.css?v=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
|
11
11
|
</head>
|
12
12
|
<body>
|
13
13
|
<section class="page-header">
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
8
|
<meta name="theme-color" content="#157878">
|
9
9
|
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
|
10
|
-
<link rel="stylesheet" href="/assets/css/style.css?v=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
|
11
11
|
</head>
|
12
12
|
<body>
|
13
13
|
<section class="page-header">
|
data/docs/_site/Code.html
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
8
|
<meta name="theme-color" content="#157878">
|
9
9
|
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
|
10
|
-
<link rel="stylesheet" href="/assets/css/style.css?v=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
|
11
11
|
</head>
|
12
12
|
<body>
|
13
13
|
<section class="page-header">
|
@@ -47,16 +47,16 @@
|
|
47
47
|
=end</span>
|
48
48
|
|
49
49
|
|
50
|
-
<span class="k">class</span> <span class="nc">PlayRockPaperScissorsGame</span>
|
50
|
+
<span class="k">class</span> <span class="nc">PlayRockPaperScissorsGame</span> <span class="c1"># define master class</span>
|
51
51
|
|
52
52
|
<span class="k">module</span> <span class="nn">RockPaperScissors</span>
|
53
|
-
<span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"2.
|
53
|
+
<span class="no">VERSION</span> <span class="o">=</span> <span class="s2">"2.4.0"</span> <span class="c1"># define version constant</span>
|
54
54
|
<span class="k">end</span>
|
55
55
|
|
56
56
|
<span class="c1"># intiate the colorize gem</span>
|
57
57
|
<span class="nb">require</span> <span class="s2">"colorized_string"</span>
|
58
|
-
<span class="no">ColorizedString</span><span class="p">.</span><span class="nf">colors</span>
|
59
|
-
<span class="no">ColorizedString</span><span class="p">.</span><span class="nf">modes</span>
|
58
|
+
<span class="no">ColorizedString</span><span class="p">.</span><span class="nf">colors</span> <span class="c1"># colors; ex: red, green, blue</span>
|
59
|
+
<span class="no">ColorizedString</span><span class="p">.</span><span class="nf">modes</span> <span class="c1"># modes; ex: bold, italic, underline</span>
|
60
60
|
|
61
61
|
<span class="k">module</span> <span class="nn">Constants</span>
|
62
62
|
<span class="no">NTRY_TO_SYM</span> <span class="o">=</span> <span class="p">{</span> <span class="c1"># define constants from an entry to a symbol class</span>
|
@@ -72,7 +72,7 @@
|
|
72
72
|
<span class="p">[</span><span class="ss">:PAPER</span><span class="p">,</span> <span class="ss">:ROCK</span><span class="p">],</span>
|
73
73
|
<span class="p">[</span><span class="ss">:ROCK</span><span class="p">,</span> <span class="ss">:SCISSORS</span><span class="p">]</span>
|
74
74
|
<span class="p">]</span>
|
75
|
-
<span class="no">LOSERS</span> <span class="o">=</span> <span class="no">WINNERS</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">
|
75
|
+
<span class="no">LOSERS</span> <span class="o">=</span> <span class="no">WINNERS</span><span class="p">.</span><span class="nf">map</span> <span class="p">{</span> <span class="o">|</span><span class="n">wp</span><span class="p">,</span><span class="n">lp</span><span class="o">|</span> <span class="p">[</span><span class="n">lp</span><span class="p">,</span><span class="n">wp</span><span class="p">]</span> <span class="p">}</span> <span class="c1"># this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player</span>
|
76
76
|
<span class="no">INIT_STRINGS</span> <span class="o">=</span> <span class="p">[</span>
|
77
77
|
<span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"You are about to enter a rock-paper-scissors best of 3 match."</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:green</span><span class="p">),</span>
|
78
78
|
<span class="no">ColorizedString</span><span class="p">[</span><span class="s2">"Press the return/enter key to continue..."</span><span class="p">].</span><span class="nf">colorize</span><span class="p">(</span><span class="ss">:green</span><span class="p">),</span>
|
@@ -165,12 +165,11 @@
|
|
165
165
|
<span class="k">end</span>
|
166
166
|
<span class="k">end</span>
|
167
167
|
|
168
|
-
<span class="nb">private_methods</span> <span class="ss">:PrivateMethods</span>
|
168
|
+
<span class="nb">private_methods</span> <span class="ss">:PrivateMethods</span> <span class="c1"># make the PrivateMethods module private</span>
|
169
169
|
|
170
170
|
<span class="k">end</span>
|
171
171
|
|
172
|
-
<span class="no">PlayRockPaperScissorsGame</span><span class="p">.</span><span class="nf">new</span><span class="p">.</span><span class="nf">play</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="c1"># call the play method and pass in 3 for the winning score</span>
|
173
|
-
|
172
|
+
<span class="no">PlayRockPaperScissorsGame</span><span class="p">.</span><span class="nf">new</span><span class="p">.</span><span class="nf">play</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="c1"># call the play method and pass in 3 (0, 1, 2) for the winning score</span>
|
174
173
|
</code></pre>
|
175
174
|
</div>
|
176
175
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
8
|
<meta name="theme-color" content="#157878">
|
9
9
|
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
|
10
|
-
<link rel="stylesheet" href="/assets/css/style.css?v=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
|
11
11
|
</head>
|
12
12
|
<body>
|
13
13
|
<section class="page-header">
|
data/docs/_site/Testing.html
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
8
|
<meta name="theme-color" content="#157878">
|
9
9
|
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
|
10
|
-
<link rel="stylesheet" href="/assets/css/style.css?v=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
|
11
11
|
</head>
|
12
12
|
<body>
|
13
13
|
<section class="page-header">
|
data/docs/_site/index.html
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
8
|
<meta name="theme-color" content="#157878">
|
9
9
|
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
|
10
|
-
<link rel="stylesheet" href="/assets/css/style.css?v=
|
10
|
+
<link rel="stylesheet" href="/assets/css/style.css?v=1f125202e42a106a6b4abb42b4f3e03091e8d2e1">
|
11
11
|
</head>
|
12
12
|
<body>
|
13
13
|
<section class="page-header">
|
data/lib/Constants.rb
CHANGED
@@ -12,10 +12,10 @@ module Constants
|
|
12
12
|
WINNERS = [
|
13
13
|
# format: player choice, computer choice
|
14
14
|
[:SCISSORS, :PAPER],
|
15
|
-
[:PAPER, :ROCK],
|
16
|
-
[:ROCK, :SCISSORS]
|
15
|
+
[:PAPER , :ROCK],
|
16
|
+
[:ROCK , :SCISSORS]
|
17
17
|
]
|
18
|
-
LOSERS = WINNERS.map { |
|
18
|
+
LOSERS = WINNERS.map { |wp,lp| [lp,wp] } # this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
|
19
19
|
INIT_STRINGS = [
|
20
20
|
ColorizedString["You are about to enter a rock-paper-scissors best of 3 match."].colorize(:green),
|
21
21
|
ColorizedString["Press the return/enter key to continue..."].colorize(:green),
|
data/lib/rps/version.rb
CHANGED
data/rps.gemspec
CHANGED
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|