mastermind-nowsiany 1.0.1 → 1.0.2
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 +1 -1
- data/lib/mastermind/cli.rb +1 -1
- data/lib/mastermind/interact.rb +26 -10
- data/lib/mastermind/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: bf410ef9127e628bb4d035ba3122d50dc15c05cc
|
4
|
+
data.tar.gz: 8a75801e1b0da4d76a47778530946f81145d2a47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74352089cefe463b797308e0bb3adc6694d5204205e380aee2e4c2ca339f9857f49452e38da6e13a97768dd309bbbf97ae494977c8c246b0cd029d6b2b32fab6
|
7
|
+
data.tar.gz: e5165cf3d0300d0792a9d75c048b3c1247aced495c59a4143270ec2022b2fab9f2d5e68c8ede6b0ad4fadc930e3718878aceb477683d816c456f493caad5f59e
|
data/README.md
CHANGED
data/lib/mastermind/cli.rb
CHANGED
@@ -30,7 +30,7 @@ module Mastermind
|
|
30
30
|
def process_command
|
31
31
|
case
|
32
32
|
when quit? then outstream.puts interact.print_farewell
|
33
|
-
when instructions? then outstream.puts interact.print_instructions
|
33
|
+
when instructions? then outstream.puts interact.print_instructions(Mastermind.color_option_string(6))
|
34
34
|
when play? then Mastermind::PlayGame.new(instream, outstream, interact).run
|
35
35
|
else outstream.puts interact.print_invalid(command)
|
36
36
|
end
|
data/lib/mastermind/interact.rb
CHANGED
@@ -28,12 +28,12 @@ _/ _/ _/_/_/ _/_/_/ _/_/ _/_/_/ _/ _/ _/ _/ _/
|
|
28
28
|
blank_line +
|
29
29
|
"
|
30
30
|
====================================
|
31
|
-
|
|
31
|
+
| MASTERMIND MAIN MENU |
|
32
32
|
| ---------------------------------- |
|
33
33
|
| |
|
34
|
-
| (i)
|
35
|
-
| (p)
|
36
|
-
| (q)
|
34
|
+
| (i)nstructions |
|
35
|
+
| (p)lay |
|
36
|
+
| (q)uit |
|
37
37
|
| |
|
38
38
|
====================================
|
39
39
|
".colorize(:green) +
|
@@ -46,12 +46,12 @@ _/ _/ _/_/_/ _/_/_/ _/_/ _/_/_/ _/ _/ _/ _/ _/
|
|
46
46
|
blank_line +
|
47
47
|
"
|
48
48
|
====================================
|
49
|
-
|
|
49
|
+
| MASTERMIND GAME OPTS |
|
50
50
|
|------------------------------------|
|
51
51
|
| |
|
52
|
-
| (s)
|
53
|
-
| (m)
|
54
|
-
| (q)
|
52
|
+
| (s)ingle player |
|
53
|
+
| (m)ulti player |
|
54
|
+
| (q)uit |
|
55
55
|
| |
|
56
56
|
====================================
|
57
57
|
".colorize(:green) +
|
@@ -118,9 +118,25 @@ Thanks for playing
|
|
118
118
|
"
|
119
119
|
end
|
120
120
|
|
121
|
-
def print_instructions
|
121
|
+
def print_instructions(colors)
|
122
122
|
"
|
123
|
-
|
123
|
+
Mastermind is a code breaking game for one or two players.\n\n"+
|
124
|
+
"##SINGLE PLAYER##".colorize(:green)+
|
125
|
+
"\nIn a single player game, when starting, the computer generates a secret code that you need to
|
126
|
+
guess. The code will consist of 4 colors out of a possible 6. The possible colors are:
|
127
|
+
#{colors}
|
128
|
+
|
129
|
+
The code that you will be guessing will be something like 'RRGB'. Note that duplicate colors
|
130
|
+
may be present in the code.
|
131
|
+
|
132
|
+
You will be given 12 guesses to guess the correct answer. If you guess correctly, you will see
|
133
|
+
the number of guesses it took you to guess the correct answer along with the amount of
|
134
|
+
time that it took you to guess correctly.\n\n"+
|
135
|
+
"##MULTI PLAYER##".colorize(:green)+
|
136
|
+
"\nIn a multi player game, the game play is the same as single player, but each player chooses
|
137
|
+
the code that their opponent must guess. After each player has chosen a secret code, players
|
138
|
+
will alternate guessing their code until either, each player finishes, or the players run out
|
139
|
+
of guesses.
|
124
140
|
"
|
125
141
|
end
|
126
142
|
|
data/lib/mastermind/version.rb
CHANGED