Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ "Sorry" game

Name: Anonymous 2010-03-11 17:43

    So i have a c++ project for one of my classes where i basically have to recreate the hasbro game "sorry". Im not much of a programmer so i was hoping I could get a little help from you guys. First thing i have to do is be able to read the board. This is what im given:

    /* The Board */
    //////////////////////////////////////////////////////////

    // The different kinds of squares.
    enum SquareKind {
    REGULAR,
    BEGIN, // Begins a slide
    END, // Ends a slide
    STARTSQ, // Start square for a player
    HOMESQ // Home square for a player
    };

    const int MAXKINDS = HOMESQ+1;
    const string kindNames[MAXKINDS] = {"REGULAR", "BEGIN", "END",
    "STARTSQ", "HOMESQ"};

    struct Role { // The role played by a square
    SquareKind kind;
    Color color; // NONE if kind is REGULAR
    };

    struct Pawn {
    Color color; // Color of this pawn, NONE if "no pawn here"
    int num; // Number of this pawn, if Color != NONE
    };

    // Note: Each square is guaranteed to play at most one slide role,
    // and at most one start/stop role.
    struct Square {
    Role slide; // Slide start, end, or REGULAR
    Role ends; // Player start, home, or REGULAR
    Pawn occupant; // Pawn on this square (if any)
    };

    // The board
    struct Board {
    int numSquares; // How many squares total
    Square squares[MAXSQUARES];
    };

    there are a total of 60 squares, including these:

    SQUARES 60
    1 BEGIN GREEN
    2 HOMESQ GREEN
    4 END GREEN
    4 STARTSQ GREEN
    9 BEGIN GREEN
    13 END GREEN
    16 BEGIN RED
    17 HOMESQ RED
    19 END RED
    19 STARTSQ RED
    24 BEGIN RED
    28 END RED
    31 BEGIN BLUE
    32 HOMESQ BLUE
    34 END BLUE
    34 STARTSQ BLUE
    39 BEGIN BLUE
    43 END BLUE
    46 BEGIN YELLOW
    47 HOMESQ YELLOW
    49 END YELLOW
    49 STARTSQ YELLOW
    54 BEGIN YELLOW
    58 END YELLOW

    So could anyone give me some help with how to read the board please?

Name: Anonymous 2010-03-12 0:52

>>7
a lot of substandard programmers use it, to the point where it's much much easier to generate total and utter crap with it
I know English is Linus's second language, but this is just bad writing. As soon as I read to the point where I assume that the following clause will be a consequence of the previous clause; or at the very least have some logical connection. But that is not the case at all, for the two clauses turn out to be completely independent. If we can't trust this man to write a simple sentence, why is he in charge of an operating system?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List