EdwinSanFI / Project-Slot

Made on Java. This project helped me to get a job at IBM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🎰 SLOT 🎰

Slot

Welcome to the Slot Machine Java application! This project is a casino-themed game developed using Java and designed to demonstrate the principles of Object-Oriented Programming. Experience the thrill of a casino environment and test your luck with this interactive game.

Table of contents

Overview

This application features a user login system with a database (file) for storing account information, a main menu for accessing various game options, and an immersive slot machine gameplay experience. The project showcases the following OOP concepts and Java programming techniques:

  • Inheritance
  • Polymorphism
  • Abstraction
  • Constructors
  • Getters and Setters
  • Design Pattern (Prototype)
  • Interfaces
  • Exception Handling (try-catch)
  • Access Modifiers
  • Packages
  • File Handling

Get started

Clone the respository

Using git

git clone git@github.com:EdwinSanFI/Project-Slot.git

Compile and Run the project

  • To compile the project
javac Slot/Slot.java
  • To run the project
java Slot.Slot

Play and Enjoy the project! :D

File Organization

This is the file organization using package.

Package

How to play?

  1. You have to run the project first.

First menu

  1. The first step is to enter the game with your account (username and password), If you don't have an account you can Create one.

Logged succesful

  1. The program will display a welcome message showing the amount of dollars and credit you have.

  2. If you have enough money, you can play by entering option #1, otherwise you will have to deposit money into your account and a second menu with new options will open up.

Second menu

  1. After choosing option 1, the program will give you the option to enter the letter P to pull the lever or enter the letter E to exit the game

Play menu

  1. When you enter the letter P, it will ask you to enter the bet (only accepts bets of 5, 7, 10, 15, 20, 30, 50 or 100 dollars) and after entering the bet, the result of the roulette will be printed.

Roulette

You can review here the ways you can win.

You can review here the explanation of the results.

You can review here some examples when you win.

You can review here the prize table.

  1. The program will repeat the previous menu until the money runs out or you decide to leave (by entering the letter E).

Roulette

  1. After leaving, the second menu will appear. In the menu:

Roulette

Roulette

How to create an account?

  • You must enter option 1 in the console.
  • The program will ask you for the username and password twice, once to save it and once to confirm the password.
  • You should see a message that the account was created successfully, if this is not the case, you entered the passwords wrong and you must re-enter the passwords

Combinations

  • Then, you need to log in to your account. As the account is new you do not have money available, therefore you must deposit money.

Combinations

How to deposit money?

  • Choose the option 2- Modify Account

Combinations

  • Choose the option 1- Deposit dollars

Combinations

  • Enter the amount, the minimum balance to enter the account is 20 dollars and the maximum is 1,000,000 dollars.

Combinations

  • If you enter an amount outside the range, it will display an error message.

Combinations

Change dollars to credits

  • The program will print the amount of dollars available to convert to credits. With this, you can decide the quantity.

Combinations

  • But if you decide to exchange more more then you have, the program will print an error message.

Combinations

Change credits to dollars

  • The program will print the amount of credits available to convert to dollars. With this, you can decide the quantity.

Combinations

  • But if you decide to exchange more more then you have, the program will print an error message.

Combinations

Withdraw dollars

  • The program will print the amount of dollars available to withdraw. With this, you can decide the quantity.

Combinations

  • But if you decide to withdraw more dollars than you have available, the program will print an error message.

Combinations

Winning examples

Example 1

Example 1 winning

Example 2

Example 2 winning

Example 3

Example 3 winning

Example 4

Example 4 winning

Example 5

Example 5 winning

Example 6

Example 6 winning

Example 7

Example 7 winning

How could I win?

The ways to win the game, is by having the items displayed in at least one of these 5 prize lines.

Prizes

But there is the possibility that prize lines are mixed and thus have a higher reward, for example:

  • Get the first line with 4 items and the last line with 3 objects
  • Get the V line with 3 items and /\ line with 4 objects
  • Get the V line with 4 items and the last line with 4 objects

Combinations

Prize Table

This is the prize table when you bet 5 dollars. The higher your bet, the higher your prize.

Prize list

In addition, within the program you can review the prize list.

  1. After entering your account, you must choose option 3- Check prize list

Prize List in the program

  1. The prize list will be printed.

Prize List in the program

Probability

Probability to get a item.

Probability to get an object

Results

  • When you get 3 items on one line, they are painted in the color red
  • When you get 4 items on one line, they are painted in the color yellow
  • When you get 5 items on one line, they are painted in the color blue
  • When you get 3+ items on the line /\, they are painted in the color purple
  • When you get 3+ items on the line V, they are painted in the color green

Betting Table

To know what the prize is according to the bet, we use a rule of 3:

Rule of three

  • Example 1:
    • When you have 3 watermelons, you could get 160 credits when your bet was 5 dollars.
  • Example 2:
    • When you have 3 watermelons, you could get 160 credits but if your bet was of 50 dollars you will get 1,600 credits.
  • Example 3:
    • When you have 3 watermelons, you could get 160 credits but if your bet was of 15 dollars you will get 7,500 credits.
  • Example 4:
    • When you have 4 diamonds and 5 cherrys, you could get 6,500 credits but if your bet was of 30 dollars you will get 39,000 credits.

You can check the list of awards here

Experience the excitement of a casino and test your luck with this interactive Slot Machine Java application!

Contributions & Feedback πŸ’¬

I appreciate any feedback and suggestions to improve my projects, as well as contributions to the code. Feel free to create an issue or submit a pull request if you'd like to contribute.

Connect With Me 🀝

If you have any questions, want to discuss ideas or just want to connect, feel free to reach out to me on LinkedIn, GitHub, Twitter, Instagram.

Thank you for visiting my Project Slot repository, and I hope you enjoy exploring my project! πŸ˜ƒ

About

Made on Java. This project helped me to get a job at IBM

License:MIT License


Languages

Language:Java 100.0%