|
can I use addresses higher than 4000? |
Although the code is not supposed to be that long, the new limit is 12000. try not to go over this limit!
|
Is the number of seconds inserted by the user octal or decimal? |
*All* inputs and outputs from\to attacker\defender are decimal.
|
Can we assume that the user won't guess in the same square twice? (as in the
last exercise). |
Yes
|
Is the attacker's name also up to 10 characters long? |
Yes.
|
What do you mean by "Be careful of overflow", when caculating
the product of Rate and the number of seconds the user inputs? |
Say rate is 50000, and the user inputs 500 seconds for the game time. The product of 50000 and 500 is a value that needs more then 16 bits (which is more then one word). If this is the case you have to implement your own way of counting 50000*500 clock interrupts. How ? Well, solving this issue is a part of the exercise.
|
Can I assume that the printer is faster than user typing? |
No. After every character that the user types, you have to make sure it was actually printed before managing the next character.
|
Can I assume that 'guesses' is only one digit? |
No. guesses can be every number in the range 1,2,...,2^16-1 , which is the range of unsigned word. Note that guesses can NOT be 0!
|
Say guesses is 4, does it mean that after 4 wrong guesses game ends, or 5? |
4
|
fter we start to count clock interupts, do we have to stop counting whenever we print to the screen? |
No need to stop counting.
|
If the time is up in the middle of printing, do I have to finish printing and only then print the message says that the time is up? |
No, you can stop the program in the middle of printing, but make sure that the message says that the time is up is printed in a new line.
|
regarding the placement of the ship by the defender.
Is every character entered by the user seperated a <space>? |
There are spaces ("1 1 1 D" and not "111D").
|
Can I use 'busy wait' mechanism for input and output? |
You must use the interrupt mechanism for input. (As writen in the last page in the exercise). For output you can choose what to use.
|
Can I assume that if, for example, the defender inserts 230001 for the
string that represents how many submarines he would like that will be in the
game, then he would not try to insert a sub in length 3? |
No
|
When printing the Board after every placement of submarine by the
defender, can I add spaces between characters ('*' or 'O'), as shown in the
example? |
Yes, it is even better, but you don't have to do it.
|
|