Bridge Codeless

One of the most popular and challenging card games. The object of the game is to take as many “tricks” as possible. Each hand, you and your teammate bid against the opposing 2-player team to decide how many tricks are to be taken by the top bidding team. After the bidding is over, each player plays a card and the highest card takes the trick, and play continues until all cards have been played.

 

Design-Time

·      hand: Rack-grid object of length 4 (no. of suits). Boolean property local is set to true, meaning each player has own copy. Orientation is vertical, not horizontal, with horizontal offset (distance between adjacent cards) equal to 150 percent of the width of an upper-case letter.

·      dummy: Rack-grid object of length 4 (no. of suits). Boolean property local is set to false, meaning only one copy exists (all players share the same copy). Orientation is vertical, not horizontal, with horizontal offset (distance between adjacent cards) equal to 150 percent of the width of an upper-case letter.

·      bidding-grid: Table-grid object, 3 columns, as many rows as will fit in its space. Column headings: Player Name, Bid Level, Suit. The current player name (North, South, West, or East) is displayed in the first column, by entering $P0 in that column. The 2nd and 3rd columns are each associated with a combo box, enabling the user to select desired bid level and suit without having to type it in.

·      dummy-container: A tabbed notebook object with 3 tabs, one for the dummy, one for the bidding-grid, and one for the score-grid.

·      score-grid: Editable-grid object, 2 columns, as many rows as will fit in its space. An Editable-grid is similar to a StringGrid object in Delphi, except that it can be edited at run-time (and at live-design-time, of course). Persistent property is set to true, meaning that the contents of this grid will survive a call of the new-game method of the game-server object.

·      deck: Std-deck object (a standard 52-card deck of playing cards).

·      trick: Tile-stack object, with horizontal offset (distance between adjacent cards) equal to 150 percent of the width of an upper-case letter.

 

Run-Time

·      Dealing: All 4 players must deal 13 cards to themselves, by dragging cards from the deck to their hands.

·      Bidding: Name of current player (North, South, West, or East) is displayed in 1st column of bidding-grid, when clicked on. Current player selects bid level and suit using combo boxes in 2nd and 3rd columns of bidding-grid. At end of bidding, declarer's partner drags each Tile-stack (suit) in his/her hand to dummy.

·      Playing a Tile: Player clicks on desired card, sending it to the trick Tile-stack, and then clicks on "Next Player" button (or presses Enter).

·      Taking the trick: Trick-taker clicks on "handle" of trick Tile-stack, sending it to the deck Tile-stack. Trick-taker then clicks on appropriate trick-counter Counter-object (there are 2 of these: North/South and West/East).

·      End of hand: Score-keeper calculates score manually, enters it into score-grid, and clicks on the "New Hand" button, which is like a "New Game" button except that the score Table-grid is not re-initialized.