2 Replies - 9445 Views - Last Post: 16 February 2009 - 10:46 AM Rate Topic: -----

#1 Re@p3rM4n  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 42
  • Joined: 05-February 08

java board game theory

Post icon  Posted 07 March 2008 - 09:14 AM

I am trying to make a board game but having little success. Could someone explain to me the logic behind such a game like checkers. Should I use a 2d array or...?
I am not asking for code, but a logical sequence/algorithm
thanks,
-R
Is This A Good Question/Topic? 0
  • +

Replies To: java board game theory

#2 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5641
  • View blog
  • Posts: 12,359
  • Joined: 16-October 07

Re: java board game theory

Posted 07 March 2008 - 09:28 AM

Start with two classes. One to hold the "cell", or place on the board that's dynamic, can contain pieces, etc. If the peices have different states, you may want to make a class for that as well. Make a Board class full of cells and give it methods like Init, Move, isWin, that sort of thing. Keep the class structure that manages state away from the display structure, it will make things easier.

Hope this helps.
Was This Post Helpful? 1

#3 casingh  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 29
  • Joined: 19-January 09

Re: java board game theory

Posted 16 February 2009 - 10:46 AM

View Postbaavgai, on 7 Mar, 2008 - 08:28 AM, said:

Start with two classes. One to hold the "cell", or place on the board that's dynamic, can contain pieces, etc. If the peices have different states, you may want to make a class for that as well. Make a Board class full of cells and give it methods like Init, Move, isWin, that sort of thing. Keep the class structure that manages state away from the display structure, it will make things easier.

Hope this helps.



This helps, but i would like to know if it's a good idea to integrate the piece with the board and also if the pieces can be an array in each player class.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1