Author: Leslie Horace
Purpose: C programs utilizing interprocess communication
Version: 1.0
- war_pipes.c
- Implementation of pipes and processes
- war_sockets.c
- Implementation of sockets and threads
- Makefile
- Compiling program(s) and cleaning out files
make all
make war_pipes
make war_sockets
make clean
usage: < outfile > <# rounds>
# rounds argument is the number of rounds to play war
- war_pipes.c
- Forks two child processes to play rounds of war
- Parent process is the game keeper and makes all requests
- Message passing is implemented with uni-directional pipes
- war_sockets.c
- Creates two child threads to play rounds of war
- Parent process is the game keeper and makes all requests
- Message passing is implemented with local host socket
- War game logic
- Each round, the parent request each child to draw a card
- In the case of a tie, the parents request each childs suit
- If the suits are also tied, the round has no winner
- After each round, the winning child gets +1 point
- Card scoring values are the same for a typical card game
- Once all rounds are completed, the results are tallied