Tuesday, April 8, 2008

Now That's a Lot of Treasure!

I wrote a class called TreasureSpreader yesterday.

This screen shot is the result. Today, I'll write code which calculates a random probability of each square containing treasure which should only take a few minutes. I tested it with total spreading to make sure every cell was getting visited.

I was going to go into more depth in this article but I'll wait until I refine the code some more. Yes, it's flood fill, but I'm separating the flood from the fill to make it more reusable. Should be cool!

No comments: