How do I prevent a file from being #include
d
more than once?
For each of your header files, you should bracket the contents
of the file with a couple of preprocessing directives, as shown in the
following example.
Suppose your file is called foo.h
. Then, as the very first
two lines of the file, you should have:
#ifndef FOO_H
#define FOO_H
At the bottom of the file, you should have as your last line:
#endif
This will prevent a file from being included more than once (which
causes multiple redefinition errors).
For an example of this, check out the tournament
header file.
Reduction in requirements
As announced in class yesterday, there has been a reduction in requirements
needed to be eligible for 100% of the marks on this assignment:
What is a seed and how is it relevant to the random
player?
Read pp. 570-571 of your King textbook for an explanation of pseudorandom
number generation and the role of seeds in this.
Is there a specific cutoff depth for minimax?
No. As noted in the assignment specification, the depth is specified
by the user. The larger the depth, the more moves the minimax algorithm
looks ahead in the game tree (which presumably would make the computer
play smarter). Your minimax function(s) should therefore be able to
carry out minimax to any depth >= 1.
Why are there two getWinner
functions
in the sample Board
module?
Because the documentation wasn't proofread well. :-) Of course, there
should only be one. That's been corrected.