Skip to content
horse race CLI game in python
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__pycache__
README.md
high_stakes_stakes.py
horses.py
odds.py
race.py
tests.py
wallet.py

README.md

How to Run:

To Play Game: install numpy in terminal cd into high_stakes_stakes in terminal type python3 high_stakes_stakes.py

To run tests: install unittest in terminal type python3 -m unittest tests.py

Created June 2019 by Author Paige Jones for Boston University Masters Class Information Structures with Python

For my final project I created a CLI game called High Stakes Stakes. I came up with the idea for this game because of my love for the triple crown horse races. I thought it would be a good opportunity to learn how to implement a Wallet feature along with betting. The concept of the game is to guess which horses will win the race and place bets on those horses.

The trickiest part of this project for me was figuring out how to compare the users input to the winning horses and only output the number of winning horses to match the type of bet the user made.

One thing I think I took away from this project was a true understanding of when and why you would want to use an init method. When we learned about them in class I had a hard time visualizing when to use it in code - but after using it for my wallet in this project I feel like I have a stronger grasp on it. I also used my first private method in this project – so that is progress!

If I were to expand on this project in the future I would create a payout Class that pays higher amounts for exotic bets. I would also like to learn how to create a GUI for the race part of the game. I also know that code that is DRY is best, and while I have tried to be concise on each page – I hope as I continue to learn to code that I will understand how to reuse blocks of code even further.

This class was my first introduction into python and I am fairly new to programming overall. I learned a lot and feel proud that I was able to successfully program this game by myself. I have a fine arts background and visualizing everything we have learned in class in a creative way has really helped to cement these concepts. Thank you for having me as your student!

REQUIREMENTS: at the minimum at least of of each of the following: [X]container type (list, tuple, set or dictionary) [X]iteration type (for, while) [X]condiditional (if) [X]try blocks [X]user-defined functions [X]input and or output file (submit input data) [X]user-defined class. the class must be imported by your main program and have the following required structures. [X]- at least 1 private and 2 public self attributes [X]at least 1 private and 1 public method that takes arguments, return values and are used by your program [X]an init() method that takes at least one argument [X]a repr() method

[X]provide unit tests that prove your class methods work as expected. the tests should evaluate results using the assert statements.

if you desire to include a module that is not part of the standard python build you must first get permission from the facilitator.

when submitting your project the instructions for installing the module must be included in the instructions for running the code

You can’t perform that action at this time.