PlayRockPaperScissorsGame 2.3.9 → 2.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c1b68b858d58619d954ea997953970840015c60
4
- data.tar.gz: befc38a57e86d5a1c3bee6019f8c6c81f7fce80f
3
+ metadata.gz: 78bf8c09ea90185dc255a22beed8d25a2b57f9af
4
+ data.tar.gz: 68844fc512004f60ea5a08198cb0a8b8e5a1975f
5
5
  SHA512:
6
- metadata.gz: c9c201ea3b8b9137cdf66a18d1837fd3d29a0b6762aad28538e7d39865c8734004d7ce167810ab332e6d42230225d3e6cdaa1a3db8d1669966abd69e691f4545
7
- data.tar.gz: a31b9b5855773e9320750ac09ea3a71a940b32ce009af8430665a5a29e809f40cfedbc9bc6d7f325888fb4fc741231310e60a043ef9287798a6d27dbcf5aba43
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.3.9" # define version constant
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 { |i,j| [j,i] } # this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
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=b9ae812d1a9e40be1e66eaa23c3b459c2d3396cc">
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=b9ae812d1a9e40be1e66eaa23c3b459c2d3396cc">
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=b9ae812d1a9e40be1e66eaa23c3b459c2d3396cc">
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.3.9"</span> <span class="c1"># define version constant</span>
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">i</span><span class="p">,</span><span class="n">j</span><span class="o">|</span> <span class="p">[</span><span class="n">j</span><span class="p">,</span><span class="n">i</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>
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=b9ae812d1a9e40be1e66eaa23c3b459c2d3396cc">
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=b9ae812d1a9e40be1e66eaa23c3b459c2d3396cc">
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=b9ae812d1a9e40be1e66eaa23c3b459c2d3396cc">
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 { |i,j| [j,i] } # this will take the original WINNERS array and flip the symbols, thus returning a loss for the user/player
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
@@ -1,3 +1,3 @@
1
1
  module RockPaperScissors
2
- VERSION = "2.3.9"
2
+ VERSION = "2.4.0"
3
3
  end
data/rps.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "PlayRockPaperScissorsGame"
3
- spec.version = "2.3.9"
3
+ spec.version = "2.4.0"
4
4
  spec.date = "2017-04-05"
5
5
  spec.summary = "A Rock Paper Scissors Ruby Gem"
6
6
  spec.description = <<-EOF
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: 2.3.9
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bag3318
metadata.gz.sig CHANGED
Binary file