Giter VIP home page Giter VIP logo

revisitting-java-section-5's Introduction

Loops

Here I revisit and practice the Java Fundamentals that I previously learned at Zip Code Wilmington coding bootcamp:

  • Using for loops - to run code a specific number of times
  • Using while loops - to run code as long as something is true
  • Using continue keyword - to skip a run and continue to next one
  • Using break keyword - to break out of a loop
  • How nested loops run

In the end, I complete TWO projects "Pokerito!" and "BlackJack", which test what I've learned about Loops.

I also build small series of apps to practice what I learn on the way, which can be found here: Loops Recap

Pokerito!

An interactive app where a user can play Pokerito! It's almost like poker, but the rules much simpler:

  • The dealer will give you one card
  • And the computer one card
  • Then, the dealer will draw five cards (the river)
  • The player with the most matches wins. If the matches are equal, everyone's a winner!

BlackJack

A simple, interactive version of the popular game BlackJack where a player plays against the dealer.

Logic for starting the game:

  • The dealer gives the player two cards face up
  • The dealer also starts with two cards.
  • But only one of the dealers cards is face up, the other is facedown

Logic for playing the game

  • Player draws first and can decide whether to hit or stay.
  • "Hit" = draw another card || "stay" = do nothing
  • If the player decides to hit, and their hand value exceeds 21, they go bust(lose).
  • Once player decides to stay, the dealer reveals the hidden facedown card.
  • Then the dealer must "hit" until dealer total = 17. If it is greater than 17, the dealer's turn ends.
  • Player wins if their hand value is higher than the dealer's hand.
  • Player also wins if dealer goes bust(exceeds 21)
  • Dealer wins if hand value is higher than the player

revisitting-java-section-5's People

Contributors

reicode28 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.