1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
// From an s-expression reader
void skip_whitespace();
string read_comment( const string& begin_sequence, const string& end_sequence );
sexpression_t* read_pair_or_value();
// From GreyWolf's Sudoku challenge
const int MINIMUM_GAMEBOARD_SIZE = 4;
const int MAXIMUM_GAMEBOARD_SIZE = 25;
const int MINIMUM_REGION_SIZE = 2;
// Functional predicates for use with the STL algorithms
template <typename Container>
struct member_of: std::unary_function <typename Container::value_type, bool>
{
...
};
template <typename DataType>
struct double_of: std::binary_function <DataType, DataType, bool>
{
...
};
// From QWERTYman's BlackJack (challenge)
enum Action { Hit, Stand, DoubleDown, Surrender };
const char* SuitNames[] =
{
"Joker", "Ace", "Two", "Three", "Four", "Five", "Six",
"Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"
};
const int SuitValue[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10 };
enum Suit
{
Joker = 0,
Ace = 1,
Jack = 11,
Queen = 12,
King = 13,
SoftAce = 11
};
const char* FaceNames[] = { "Spades", "Diamonds", "Clubs", "Hearts" };
enum Face { Spades, Diamonds, Clubs, Hearts };
void display_all_hands(
const deque <Hand> & hands,
bool is_show_hole_card
);
void display_player_winnings(
const deque <Money> & winnings,
const deque <Hand> & hands = deque <Hand> ()
);
void get_bets( deque <Money> & bets );
void ask_hit_or_stand(
const string& playername,
ShoeDeck& deck,
Money& winnings,
Money& bet,
Hand & hand,
Money& insurance,
bool & standing
);
|