Hey
I have to make the game War (card game: http://en.wikipedia.org/wiki/War_(card_game) ) in C. Im not sure where (how...) to start. My basic thoughts/ideas/etc:
Its a 40 (4 times 10) card version with 2 players. A way to do it would be set up a structure with 4 faces values: a, b, c, and d. Now I need that each has a value of 1 - 10 (a1, a2, a3....a10) but nonchanging. After this each player has a another structure (or array (?) ) holding 20 cards. Now out of the 40 card deck structure we have to randomly pick them out and assign them to the 2 players (this is one of the 2 big problems; No idea how to randomly pick)
The game afterwards is pretty simple: Simply each player puts out a card. If the card is larger, that player gets his card back (in a seperete deck) and the other players card. If the card is smaller, the player looses his card. If tie, player puts 2 cards with hidden value and a third card with value revelaed. That shouldnt be too hard. The game is ended when a player is without cards
Now here a hard part: There will be a clock running during the game. If someone beats the game and is in the top 10 of the fastest, his name will be added to the ranking. This is saved/loaded from a simple text file. I have no clue on how to do this.
I hope I can get some help because Ive thought about it and honestly I dont even know where to start.