Modular Programming is implemented to achieve this goal. The requirement was to achieve thread synchronization which is achieved by thread semaphore and mutex variables
which locks and unlocks the resources when needed in main program 5 threads are created 4 for players and one for dealer to atomize the random number generator for dice throw.
A single code file is compiled to run the code the following command will compile it in linux environment
Please go to the folder and execute below commands in order
gcc -std=c99 main.c -lpthread
./a .out 30
-
Notifications
You must be signed in to change notification settings - Fork 0
Dice War is a simple dice game with one dealer, 4 players, and two dice. The 4 players (let’s call them A, B, C and D) work in teams where A and C are on the same team and B and D are on the other team. The goal of the game is to have both players on the same team get the same sum. The winning team is the one in which of a player scores the same…
SnehaSirnam/Dice-War
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Dice War is a simple dice game with one dealer, 4 players, and two dice. The 4 players (let’s call them A, B, C and D) work in teams where A and C are on the same team and B and D are on the other team. The goal of the game is to have both players on the same team get the same sum. The winning team is the one in which of a player scores the same…
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published