Skip to content

as466/example_roulette

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example_roulette

Program to refactor that plays a game of roulette <<<<<<< HEAD Arthur Schweitzer (as466), Emanuele Macchi (em186)

  1. After refactoring the code there was no need for any if statements, to check which type of Bet is placed. Instead, we made 6 subclasses of the Bet superclass, which have a getUserChoice() method to return the type of Bet placed. This allows us to have a list of different types of Bets, which we can access and utilize accordingly.

  2. In terms of design, we implemented inheritance for our Bet class, which helped simplify the structure, however this was theoretically more complex in nature than using a bunch of if statements.

  3. Didn't really have to make any trade-offs, since we managed to retain all functionality while making it cleaner.

  4. We prefer our refactored code, because it's more flexible and it's easier to add new features such as a new type of Bet. =======

dcee03c2dac1db1a02e89ba5d5777b7d5dc6bbea

About

Program to refactor that plays a game of roulette

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%