Search

Saturday, August 11, 2012

Day 3: Board Representation -Coding-


Well, time to code!

Important note: I just changed: "Stone" is not needed as a class right now, if I need it in the future I will change it, for now, there will be an integer in every position: 0-No stone 1-Black Stone 2-White Stone, 3-Unplayable place

Some things about how I will program this:


  • Even if inside an IF there is only one line, I will still use the "{"
  • Lot's of comments on code.
  • Obvious comments mode=on.
First way I thought about creating the board:


This goes with the math of the last post. Puts the correct "component" in every space of the array.

So, now, just to show it on the console, in the "Console" class:


And in the "Principal" class (main), just start the program creating the board (hardcoded to 9x9 but can be changed to whatever). In the near future I will quit this from main and create a class for the game loop.
So, that's it for now, runnig this I had:

In 9x9:



In 19x19:



2 comments: