Giter VIP home page Giter VIP logo

blackjack-game's Introduction

Blackjack Game

In this mini-project you will work with a partner to complete a simple blackjack game.

Instructions

  • Create a simple blackjack game with the following properties:

    • Deals the player a random number between 4 and 21 inclusive.

      • If the player has 21 they win!
    • Deals a random number between 2 and 11 inclusive to the dealer.

    • If the player hits, add a number between 2 and 11.

      • If the player goes over 21 the lose.

      • If the player has 21, stay for them.

      • Repeat until they choose to stay or they bust

    • Once player stays add a number between 2 and 11 to the dealer's hand.

      • If dealer number is less than 17 add another number

      • Repeat until the number is over over 17 but less than 21, or if the dealer goes over 21

      • If dealer goes over 21 they lose.

    • Once dealer stops, and neither player bust, compare each number to 21. Whoever is closer wins!

  • Pseudocode the outline of your game before you write any code.

  • Create functions if you begin to repeat yourself.

Notes

This is a difficult challenge. How you build this game is up to you. The goal here is to demonstrate when to use functions. If at any point you begin to type the same line of code, or if your code becomes unreadable, consider a function!

Hints

  • Be sure that your random number generator is inclusive of the outer numbers.

  • We've used a lot of for loops. Don't forget that there are other types of loops.


© 2022 edX Boot Camps LLC. Confidential and Proprietary. All Rights Reserved.

blackjack-game's People

Contributors

ozgencmardi avatar

Watchers

 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.