-
Notifications
You must be signed in to change notification settings - Fork 30
/
README.txt
58 lines (44 loc) · 1.62 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
INTRODUCTION
GuessingGame is a simple game written in a variety of programming languages, so
that the languages themselves can be compared. The program covers many
programming fundamentals: variable declaration and manipulation (strings and
integers), screen output, keyboard input, loops, if statements, file input and
file output.
EXAMPLE
Below is an example of playing the guessing game. The program randomly picks a
number which you try to guess. You enter your name which is saved to a high
score file and the previous high scores are printed out. The version here is
the Perl version, however all versions are designed to appear as identical as
possible:
mars:> ./guess.pl
guess.pl - Guess a number between 1 and 100
Enter guess 1: 50
Higher...
Enter guess 2: 75
Lower...
Enter guess 3: 67
Lower...
Enter guess 4: 58
Lower...
Enter guess 5: 54
Higher...
Enter guess 6: 56
Lower...
Enter guess 7: 55
Correct! That took 7 guesses.
Please enter your name: Brendan Gregg
Previous high scores,
Fred Nurk 5
Fred 6
Brendan Gregg 7
And the high score file was:
mars:> ls -l highscores_pl
-rw-r--r-- 1 brendan other 35 Oct 26 01:31 highscores_pl
INSTALLATION
The programs are in the "src" directory. At the top of each program is a comment
that describes how to run the program, and compile it if necessary. There is no
installer (or Makefile), instead, read the programs themselves.
Any additional documentation is in the "doc" directory.
LINKS
http://www.brendangregg.com/guessinggame.html project website
https://github.com/brendangregg/GuessingGame source repository