valentinsoare / AGameOfChanceWithStatistics

A Game of Craps with statistics, played by one player at a time while the stats are being registered

Home Page:https://moviesondemand.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🍀 A Game of Chance - Craps

▶️ Interactive Game of Craps made in Java 17 that can be run in CLI with main and secondary menu and can take input from user and act on it after it was validated. In case something is wrong an appropriate error will be printed.

▶️ We can register, remove, select a player, print help, print statistics, print players
and play only one game of craps or play multiple games set by the player.

▶️ Games that are played are register in history and stats are calculated from the counters saved into storage arrays.

final-Small.png

Concepts/technologies used:

  1. Object-Oriented Programming Principles;
  2. Collections Framework - ArraysList, LinkedList, HashMap and Set
  3. Recursion;
  4. Comparator and Iterator;
  5. Lambda functions, Streams and Method references;
  6. Third party libraries - Apache Commons Lang and Lombok;

Note

Project is 💯 delivered!


Output from the game...

✅ Here is the loading effect (progress bar) when starting the application.

             Loading The Game Of Craps 

     [################################### 89%     ]

✅ Main menu after the loading bar completed and there is no registered player;

  -------------------------------
   # Playing The Game Of Craps # 
  -------------------------------

  [ 1 ] Games To Be Played 
  [ 2 ] Play One Game 
  [ 3 ] Print Statistics 
  [ 4 ] Register Player 
  [ 5 ] Change Player 
  [ 6 ] Reset Games Statistics 
  [ 7 ] Print Players 
  [ 8 ] Help 
  [ 9 ] Quit 

  player: None
  -------------------------------
  provide an option: 

✅ Register a player;

  -------------------------------
   # Playing The Game Of Craps # 
  -------------------------------
           Add Player

  In order to add a player please provide complete name, age, occupation separated by a comma.

  player: None
  -------------------------------
  provide the necessary information to register a player or (quit/back): 

✅ Set/Change a player after it is registered. You can have multiple registered players;

  -------------------------------
   # Playing The Game Of Craps # 
  -------------------------------
          Change Player

  [ 1 ] Valentin, Age: 35, Occupation: engineer
  [ 2 ] Back
  [ 3 ] Quit

  player: None
  -------------------------------
  please choose a player from above or back/quit option: 

✅ Set the numbers of games to be played and the loading effect with dots when setting the parameter;

  -------------------------------
   * Playing The Game Of Craps * 
  -------------------------------
        Games To Be Played

  Please you need to tell us how many games you want to be played. Statistics will be calculated. 

  player: Valentin
  -------------------------------
  provide requested information or back/quit: 50

  50 games were selected to be played.......DONE

✅ Printing statistics for those 50 games played;

-------------------------------
   * Playing The Game Of Craps * 
  -------------------------------
    Playing 50 Games Of Craps

  The Games Are Running..........DONE

  Number of Wins per roll and chances for them: 

  Rolls     Wins      Chances   
  |   1  |       8  |   16.0% 
  |   2  |       7  |   14.0% 
  |   3  |       2  |    4.0% 
  |   4  |       0  |    0.0% 
  |   5  |       1  |    2.0% 
  |   6  |       0  |    0.0% 
  |   7  |       1  |    2.0% 
  |   8  |       1  |    2.0% 
  |   9  |       1  |    2.0% 
  |  10  |       1  |    2.0% 
  |  11  |       1  |    2.0% 
  |  12  |       0  |    0.0% 
  |  13  |       0  |    0.0% 
  |  14  |       0  |    0.0% 
  |  15  |       1  |    2.0% 

  -------------------------------

  Number of Losses per roll and chances for them: 

  Rolls     Losses    Chances   
  |   1  |       5  |   10.0% 
  |   2  |       5  |   10.0% 
  |   3  |       4  |    8.0% 
  |   4  |       3  |    6.0% 
  |   5  |       1  |    2.0% 
  |   6  |       2  |    4.0% 
  |   7  |       2  |    4.0% 
  |   8  |       1  |    2.0% 
  |   9  |       1  |    2.0% 
  |  10  |       1  |    2.0% 
  |  11  |       1  |    2.0% 

  -------------------------------

      Games Played /      Wins /    Losses / Chances For Winning / For Loosing
  1.            50        24.0        26.0                  48.0          52.0

  -------------------------------

      Games Played / Average length
    1.          50              3.0

  -------------------------------

✅ Choose what to do after stats are printed;

  -------------------------------
   * Playing The Game Of Craps * 
  -------------------------------
           What To Do ?

  [ 1 ] Play Again 
  [ 2 ] Return To How Many Games To Play 
  [ 3 ] Back To Main Menu 
  [ 4 ] Quit 

  player: Valentin
  -------------------------------
  please choose an option from above: 

👉 You can check the rest of the functionalities if you clone this repo and try it.


▶️ Class dependencies

class_dependencies


Statistics

HitCount

Social buttons

valentinsoare - AGameOfChanceWithStatistics stars - AGameOfChanceWithStatistics forks - AGameOfChanceWithStatistics

Repo metadata

GitHub tag License issues - AGameOfChanceWithStatistics

License

Released under MIT by @valentinsoare 📫 Contact me

About

A Game of Craps with statistics, played by one player at a time while the stats are being registered

https://moviesondemand.io


Languages

Language:Java 100.0%