Implementing poker little by little in Ruby Part 4

Previous article

Part 1Part 2 → [Part 3](https://qiita .com / paraizo2424 / items / 6187b5b6cd7c7ebc6eca)

N players participate

Who manages how many people will participate in the game ?? Dealers? ?? For the time being, I will create a class called Game Master and leave it to me.

Who decides the outcome?

Will the dealer decide? Is it the gamemaster I made earlier? ?? For the time being, let's decide whether the game master is the facilitator of the game.

What is the victory or defeat in the same role?

In the case of one pair vs. one pair, the one with the larger number on the card wins, and if the numbers are the same, the strength of the suit is compared. I thought about it, but it's difficult, so let's do it next time. For the time being, if there are multiple strongest roles, draw, and if there is only one strongest role, that person will be the winner.

flow

The player inputs the number of participants in the game gamemaster.initialize (number of players) Gamemaster.judge to judge the victory or defeat between players

code

https://github.com/paraizo2424/poker_game/commit/b1becfe81a7b827302d0116562c8e57240e7b403

next time

Part 5 (currently under construction)

Recommended Posts