Hello, everyone.
I want to code a turkish draughts game. But i dont know where to start. I dont have any idea about how to code it. I dont want the entire code from, I only need ideas. Can you help me?
If you dont know turkish draughts: http://en.wikipedia.org/wiki/Turkish_draughts
http://www.gamerz.net/pbmserv/dama.html
You need to think about a few things first.
- Is this going to be text based (console), or graphics based?
- If graphics based, what graphics library?
- How complex do you want the computer's logic to be? i.e. does it do move look-ahead to find the best move?
My suggestion is to start with a simple text based version. Keep the text displays well isolated so that if you later decide to move to a graphics version, the text displays are easily replaced. Get the program logic working well before trying to move to a graphics version.
Some obvious things to work on:
- Drawing the board. How to represent the each side's pieces.
- How to accept input from the players?
- How to input jumps (captures)?
- Checking for game over. After each player's move, check for win or draw.
- Checking each player's move is legal.
The first thing I notice is that your board is an 8x8 array of strings.
I don't think you really want to represent each cell as a string.
You should also separate the display of the board from the playing of the game.
Are you doing this as an exercise to learn C++?
If so, I'd strongly suggest you make the board a class, with an array of cells representing each square. You could make each cell an enum such as:
Note from the enum that each cell can have 6 states. You may end up with more states (jumped, etc) as your game develops. I would actually recommend making each cell a class. In the enum above, I've combined several conditions (base color, occupied, piece color) into a single enum. That's not really the best idea. It's better to keep those states as separate variables in a class.
yes it is an exercise but i dont know how to use classes so i dont know how can i give a position to cells using enum. I am plaaning to make the board as a string. And the men will be strings too. and i will ask each player to coordinate of the man which he want to play before asking where he want to play the man. then i will check if he can play again(jumping). İf he can i will give the second change of playing