Skip to content

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…

Notifications You must be signed in to change notification settings

SnehaSirnam/Dice-War

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Dice-War

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

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

No packages published

Languages