Current Forum: Homework 6 - Part II |
Date: Wed Dec 5 2001 8:22 am |
Author: White, David <white3@andrew.cmu.edu> |
Subject: Re: GreedyPlayer broken? |
|
|
The problem is that when you clone, you don't get new static variables. So if you change those static variables in the clone, you change them in the original.
My problem specifically was that my playingBoard (int array) was stored as static. Then when Greedy player would try a move in a clone, the main board would register the move as an actual part of the game, so the board would fill up with all the tries. I'm pretty sure that having any statics would be a bad thing since you want none of your board instances messing with the other instances... I'll bet you have the same problem I had...
Good luck.. |
|