X-Git-Url: https://jxself.org/git/?p=digits.git;a=blobdiff_plain;f=digits.pl;h=73cba9a9e89e195932f33df2ceda081ce61cdef6;hp=41f376f004103d891d56196c3567bd4cc5a42e41;hb=62aa98baf0190c4e14ff406cc616924016d0bae0;hpb=29614493039fb487686024b3bf3e78a06a5064ff diff --git a/digits.pl b/digits.pl index 41f376f..73cba9a 100755 --- a/digits.pl +++ b/digits.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# Digits 1.0 +# Digits 1.0.1 # # Copyright (C) 2013 Jason Self # @@ -221,11 +221,12 @@ sub display_text { $| = 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 \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 "I will think of a number. The object of the game is to guess the number\n"; print "in as few tries as possible. Each time you guess I will provide a hint:\n\n"; print "For each digit in the correct position I will print an X\n"; @@ -376,7 +377,7 @@ sub set_game_state { 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; @@ -405,7 +406,7 @@ sub main { 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); @@ -423,6 +424,7 @@ sub main { } if ($guessed == $QUIT) { + print "\nThe number I had was @digits. Bye!\n"; last; } elsif ($guessed) {