Kaiji

Can you help me with my game, like i need a code for something like this:

there are 6 cards, 1 card of Emperor, 1 card of Slave,and 4 cards of Citizen.
An AI chooses randomly from the cards, same as the player, the following conditions are below:

condition 1:
A Emperor can defeat a Citizen but cannot defeat a Slave.

condition 2:
A Slave can defeat a Emperor but cannot defeat a Citizen.

condition 3:
A Citizen can defeat a Slave but cannot defeat a Emperor.

condition 4:
If both AI and the player chooses Citizen, the round is a tie.

This is also based on the psychological anime named Kaiji.
Ok for an easy time I would recommend using a vector/array of strings. Then you can have some rand() function that takes one value from the container (not take out, that's a whole different story) for both the player and the AI, then compares them.

You can also choose to use enums or create an entire class of types just for your cards.
Topic archived. No new replies allowed.