Code Monkey home page Code Monkey logo

roulette's Introduction

Week One Level Two Challenge - Roulette

You will write a Java program to simulate Roulette, a casino game.

Players will be able to enter in the amount of money they want to bet and the type of bet they will be placing.

The types of bets include:

Red:You are betting that the next roll will come up red.

Black: You are betting that the next roll will come up black.

Even:This is wagering that the ball will land on an even number between 1-36.

Odd: This is wagering that the ball will land on an odd number between 1-36.

Low: This is a bet that the next number will be between 1 and 18.

High: This is a bet that the next number will be between 19 and 36.

The program will then randomly generate a number between 1-36 and a color (red or black). You will then double the player's amount if they won, or deduct their money if they lost.

Allow the user to play as many games as they want until they want to quit.

At the end of the program, print out the net amount of money they've earned, whether that's positive or negative. In addition, also print out the number of games they have won and lost.

Sample Output:

WELCOME! Let's play some Roulette!

Enter the type of bet you would like to place (red|black|even|odd|high|low): red
Enter in your bet amount: 35
The ball landed on 27 black.
Sorry, you've lost this bet.

You currently have: $-35.0

Would you like to play again (true|false)? true
Enter the type of bet you would like to place (red|black|even|odd|high|low): low
Enter in your bet amount: 40
The ball landed on 17 black.
Congratulations, you've won.

You currently have: $45.0

Would you like to play again (true|false)? true
Enter the type of bet you would like to place (red|black|even|odd|high|low): even
Enter in your bet amount: 100
The ball landed on 29 black.
Sorry, you've lost this bet.

You currently have: $-55.0

Would you like to play again (true|false)? false

Thank you for playing!
This is how much money you have remaining: $-55.00
You've won 1 game(s) and lost 2 game(s).

roulette's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.