Discussion Board
Go to the previous messageGo to the following message
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..
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
GreedyPlayer broken?      White, David      Tue Dec 4 2001 4:17 pm       
Re: GreedyPlayer broken?      Shi, Ying      Tue Dec 4 2001 4:19 pm       
Re: GreedyPlayer broken?      Maxim, Michael G.      Tue Dec 4 2001 5:43 pm       
Re: GreedyPlayer broken?      White, David      Tue Dec 4 2001 8:13 pm       
Easier GUI picking fix...      White, David      Tue Dec 4 2001 9:49 pm       
Re: Easier GUI picking fix...      White, David      Wed Dec 5 2001 8:25 am       
Re: GreedyPlayer broken?      White, David      Tue Dec 4 2001 9:26 pm       
Re: GreedyPlayer broken?      Fields, David C.      Wed Dec 5 2001 2:33 am       
Re: GreedyPlayer broken?      White, David      Wed Dec 5 2001 8:22 am       
Re: GreedyPlayer broken?      Fields, David C.      Wed Dec 5 2001 10:24 am       
Re: GreedyPlayer bro...      Liu, Limin Angela      Wed Dec 5 2001 6:24 pm       
Re: GreedyPlayer ...      White, David      Thu Dec 6 2001 10:24 am       
Re: GreedyPlayer broken?      Dozzi, Giancarlo      Fri Dec 7 2001 1:32 pm       

Back to previous screen