Hog Game

As the first computer programming projects, one of my friends and I designed a dice game done by two players. With reaching 100 points as the goal of the game, we added multiple rules that determined the players points each rounds and total score. Below is the screenshots of our code. I am in the process of developing the UI design so it is easier for more people to play the game.

hog 1.JPG

Foundation codes that lets a player roll a dice and return the sum of the numbers with an exception of 1 (special rule described below)

hog 2.JPG

Free Bacon rule

If A) a player rolls 0 dice in a round and B) the first and the last digit of the cubed number of the opponent’s score is the same, the player in the round switches the score with the opponent

hog 3.JPG

Codes that initiate the players’ taking turn

hog 4.JPG

Detailed codes for Free Bacon rule discussed above and for taking turns each round

For the full codes of the project, click below.

Hog Python

Previous
Previous

Zobeide

Next
Next

Public Space Design in People's Park