projects
/
digits.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2961449
)
Updating to version 1.0.1 - Duplicate digits can sometimes be generated when unique...
v1.0.1
author
Jason Self
<j@jxself.org>
Sat, 24 Aug 2013 04:30:05 +0000
(21:30 -0700)
committer
Jason Self
<j@jxself.org>
Sat, 24 Aug 2013 04:30:05 +0000
(21:30 -0700)
README
patch
|
blob
|
history
digits.pl
patch
|
blob
|
history
diff --git
a/README
b/README
index f212545a2d9835eacd58c10bb98d5fe3bea35c98..2815fcd07d167b9edf5163d17d55315ba0a08a87 100644
(file)
--- a/
README
+++ b/
README
@@
-1,3
+1,5
@@
+This directory contains version 1.0.1.
+
This is definitely a thinking person's game!
Distantly related to the game Mastermind, you are given clues to help
This is definitely a thinking person's game!
Distantly related to the game Mastermind, you are given clues to help
diff --git
a/digits.pl
b/digits.pl
index 41f376f004103d891d56196c3567bd4cc5a42e41..5a3f0fa09a2780104dcb520429ecc0678bb602ee 100755
(executable)
--- a/
digits.pl
+++ b/
digits.pl
@@
-1,6
+1,6
@@
#!/usr/bin/perl
#
#!/usr/bin/perl
#
-# Digits 1.0
+# Digits 1.0
.1
#
# Copyright (C) 2013 Jason Self <j@jxself.org>
#
#
# Copyright (C) 2013 Jason Self <j@jxself.org>
#
@@
-221,9
+221,10
@@
sub display_text {
$| = 1;
print "\033[2J";
print "\033[0;0H";
$| = 1;
print "\033[2J";
print "\033[0;0H";
- print "\t\t\t
\t" . '*** DIGITS ***' . "\n
\n";
+ print "\t\t\t
" . '*** DIGITS 1.0.1 ***' . "
\n";
print "Homepage: http://jxself.org/digits.shtml\n\n";
print "Copyright (C) 2013 Jason Self <j\@jxself.org>\n\n";
print "Homepage: http://jxself.org/digits.shtml\n\n";
print "Copyright (C) 2013 Jason Self <j\@jxself.org>\n\n";
+print "Licensed under the GNU AGPL v3 or any later version.\n\n";
print "I will think of a number. The object of the game it to guess the number\n";
print "in as few tries as possible. Each time you guess I will provide a hint:\n\n";
print "I will think of a number. The object of the game it to guess the number\n";
print "in as few tries as possible. Each time you guess I will provide a hint:\n\n";
@@
-376,7
+377,7
@@
sub set_game_state {
if ($DISTINCT) {
my $no_match = $TRUE;
if ($DISTINCT) {
my $no_match = $TRUE;
- for (my $j = 0; $j < $#digits; $j++) {
+ for (my $j = 0; $j < $#digits
+ 1
; $j++) {
if ($digits[$j] == $digit) {
$no_match = $FALSE;
last;
if ($digits[$j] == $digit) {
$no_match = $FALSE;
last;
@@
-405,7
+406,7
@@
sub main {
get_options();
while ($TRUE) {
get_options();
while ($TRUE) {
- print "\nWhat is your guess?\n";
+ print "\nWhat is your guess?
Type 'q' or 'quit' to exit.
\n";
$guess = read_input();
$guessed = check_digits($guess);
$guess = read_input();
$guessed = check_digits($guess);
@@
-423,6
+424,7
@@
sub main {
}
if ($guessed == $QUIT) {
}
if ($guessed == $QUIT) {
+ print "\nThe number I had was @digits. Bye!\n";
last;
}
elsif ($guessed) {
last;
}
elsif ($guessed) {