Setting up two dimensional array valuea

Discussion in 'C++' started by streamkid@gmail.com, Dec 1, 2006.

  1. Guest

    Hello...
    i have a two dimensional array of ints,
    int board[ 8 ][ 8 ];

    when i try to set each element, like that
    board[ 7 ][ 7 ] = { blcaslte, blhorse, blbishop, blking, blqueen,
    blbishop, blhorse, blcastle,
    blpawn, blpawn, blpawn, blpawn, blpawn, blpawn,
    blpawn, blpawn,
    null, null, null, null, null, null, null, null,
    null, null, null, null, null, null, null, null,
    null, null, null, null, null, null, null, null,
    null, null, null, null, null, null, null, null,
    whpawn, whpawn, whpawn, whpawn, whpawn, whpawn,
    whpawn, whpawn,
    wcastle, whorse, wbishop, wking, wqueen,
    wbishop, whhorse, whcastle };

    ofc i have enums,
    enum pieces { blcaste = 1, blhorse = 2, blbishop = 3, blking = 4,
    blqueen = 5, blppawn = 6,
    whcaslte = 7, whhorse = 8, whbishop = 9, whqueen = 10,
    whking = 11, whpawn = 12,
    null = 0 };

    but i also tried with this
    const int blcaste = 1;
    const int blhorse = 2;
    etc..

    but this didn't work either..

    any idea anybodi??
    , Dec 1, 2006
    #1
    1. Advertising

  2. Guest

    just ignore typos, that's not the code, i wrote it to post it because i
    don't have the code available atm
    , Dec 1, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alf P. Steinbach
    Replies:
    0
    Views:
    422
    Alf P. Steinbach
    Aug 18, 2003
  2. John Harrison
    Replies:
    4
    Views:
    6,912
    Default User
    Aug 19, 2003
  3. Icosahedron
    Replies:
    8
    Views:
    638
    Vivek
    Aug 21, 2003
  4. Venkat
    Replies:
    4
    Views:
    961
    Venkat
    Dec 5, 2003
  5. Frank Miller
    Replies:
    4
    Views:
    315
    Richard Bos
    Jun 11, 2009
Loading...

Share This Page