[Cs3] figured out the problem with game template method example

Mikhail Nesterenko mikhail at cs.kent.edu
Wed Oct 22 12:54:16 EDT 2014


The random number generator initializaiton was in the constructor of
the abstract Game class. The random number generator is seeded with
time functin.

Now since we play the game 15 times and destroy and re-allocate the
object every time, the constructor is invoked. Now since this happens
within the same second, the seed is the same.

I moved the initializaiton out of the constructor and it works
correctly now.

thanks,
-- 
Mikhail


More information about the cs3 mailing list