Thread: chess game

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    15

    Arrow chess game

    I'm writing a chess game using 2-dimensional array . The idea is simple:
    each piece has its own value, the destination got the piece's value if the move is valid.

    My trouble is my display fundtion does not read in the updated value.

    code:

    display() {

    int value;
    //display a blank board
    //display the char according to the piece's value

    for (int i=1; i<=8; i++
    for (int j=1, j<=8; j++) {
    value = board[i][j];

    switch(value) {

    case: 1 //do the output
    .case: 2
    ...
    }
    }

    board is a public member in my class. I don't understand why the changed values did not get in. Without using list or pointers, is this
    achievable?

    Any help is appreciated!
    Last edited by meka; 12-06-2001 at 02:06 PM.

  2. #2
    Unregistered
    Guest

    Might be your method of accessing

    I think that it might be your method of accessing the board. You did not post classname.board[i][j]. If you purposely omitted it from you post ignore this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New Project, text game, design stage.
    By Shamino in forum Game Programming
    Replies: 9
    Last Post: 05-23-2007, 06:39 AM
  2. c++ chess game help
    By jdm71488 in forum C++ Programming
    Replies: 6
    Last Post: 04-26-2004, 09:46 AM
  3. Game Programmer's AIM Circle: Join Today
    By KingZoolerius66 in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 12-20-2003, 12:12 PM
  4. Chess is the coolest game
    By Jet_Master in forum A Brief History of Cprogramming.com
    Replies: 74
    Last Post: 06-07-2002, 10:29 AM
  5. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM