Discussion:
Ouput for hangman.
(too old to reply)
Mehes Andrew F J
2004-01-23 21:32:12 UTC
Permalink
When the hangman program asks for a word or letter, should it appear on
the screen as (where a is the input);


Guess a letter:a

or

Guess a letter:
a


The same applys for the user prompt to enter a word.


Furthermore, there is at the top of the *.c files we are to submit, there
is a field "Description:" . Are we to fill this out, or this the
description given by the caption that apeears beneath it?


Thanks.
Alexander Smith
2004-01-23 21:59:25 UTC
Permalink
The second version below is the correct output for hangman. The same
applies to the other prompts in hangman and in the guessing game.

To check the output of your program, you can do the following:

./hangman < in1.txt | grep -v # > myout1.txt
grep -v # out1.txt > testout1.txt
diff testout1.txt myout1.txt

The first line runs your program with the "in1.txt" input, strips all
lines containing a number sign (#), and sends the output to "myout1.txt".
The second line removes all lines containing a number sign from the sample
output file "out1.txt" and writes the result to "testout1.txt". The third
line compares your output to the sample output.

The third line above should produce no output. (I.e. when you run it,
nothing should happen.) If the files are different, then you will get
output showing you where they differ.

The marking TA will probably use a similar procedure in the auto-marker.
So, if the above procedure works for you, chances are good that you've
written the program correctly.

Alexander
Post by Mehes Andrew F J
When the hangman program asks for a word or letter, should it appear on
the screen as (where a is the input);
Guess a letter:a
or
a
The same applys for the user prompt to enter a word.
Furthermore, there is at the top of the *.c files we are to submit, there
is a field "Description:" . Are we to fill this out, or this the
description given by the caption that apeears beneath it?
Thanks.
Loading...