   chess game
  Well I have decided to work on  a chess game. I have setup an array to hold the chess pieces.I want to use oop technique.This uses classes.I am using straight c++.I am unsure of how to proceed further.   
  Create an heirarchy maybe something like this :struct Piece{  void move()const = 0; //... ~Piece() = 0{  }};class Pawn : public Piece{ //...};class Rook : public Piece{ //...};So the idea is that you can use polymorphism to move the piece among other things.Before even coding something like this, work it out on paper.   ;  I think I will use some uml to work it out on paper. Thanks for the reply.   ;  Are you trying to learn about OOP, or are you trying to make a chess program? In my experience, the OOP paradigm has very little to offer to help you solve anything important in a chess program.Starting with a description of the board is good, and having a class for that makes perfect sense. Having a base class for the pieces, as Concentrate suggests, will probably not simplify matters much at all, and virtual functions are costly. I know this smells of premature optimization, but using polymorphism for this task stinks of "premature abstraction".What you need to do next is create a class that describes a move, and then write a function that, given a board, populates a container with the available moves.After that, it depends on what you mean by "chess game". You may intend to write a GUI so people can play chess on it, or perhaps you want to write an engine that will decide what moves to make on its own, so you can play against it. Or perhaps you want both. I strongly recommend that you keep those as two separate programs, which would then communicate using some text protocol (probably UCI, look it up).Good luck.   ;Quote:Original post by ConcentrateCreate an heirarchy maybe something like this :struct Piece{  void move()const = 0; //... ~Piece() = 0{  }};class Pawn : public Piece{ //...};class Rook : public Piece{ //...};So the idea is that you can use polymorphism to move the piece among other things.Before even coding something like this, work it out on paper.Why do this, what do you gain? What commonality is there that can't be better expressed through composition? This is for beginners; there is pressure to provide good solutions as a beginner is less likely to challenge questionable engineering.