Project developed for the Programming Course at Instituto Superior Técnico. This game can support up to 4 human or AI players at the same time. The AI players have winning strategies implemented.
In order to run this game you will need the SDL2, SDL2_image and SDL2_ttf libraries.
In the command line just go to your .c
for the Midterm Submission and type the command:
gcc BlackJackGUI.c -g -I/usr/local/include -Wall -pedantic -std=c99 -L/usr/local/lib -lm -lSDL2 -lSDL2_ttf -lSDL2_image -o blackjack
For the Final Submission, do the same thing and type the command:
gcc <all_c_files>.c -g -I/usr/local/include -Wall -pedantic -std=c99 -L/usr/local/lib -lm -lSDL2 -lSDL2_ttf -lSDL2_image -o blackjack
- Replace
<all_c_files>.c
with the all the.c
files found in the Final Submission folder separated with a space.
- Replace
To execute the code in Midterm Submission just type on your console ./blackjack
To run the Final Submission type on your console ./blackjack <game_config_file>.txt <AI_config_file>.txt
- Replace
<game_config_file>.txt
withconfig_jogo.txt
and<AI_config_file>.txt
withficheiro_config_EAs.txt
- Hit: H key
- Stand: S key
- Double: D key
- Surrender: S key
- New Game: N key
- Quit: Q key
The <game_config_file>.txt
contains information about the number of decks (4 to 8), the number of players (1 to 4).
For each player you must indicate the type of player (HU: human or EA: bot), the players names (max 8 characters), the initial money (10 to 500) and the initial bet.
At the end of the game a stats file is written containing the name and type of each player, the number of wins, ties and losses, final money and the casino house money balance.