Git Product home page Git Product logo

ms-excel-blackjack's Introduction

Project Preview Image

Microsoft Excel Blackjack (Twenty-One)

The purpose of this project was to test the built-in capabilities of Microsoft Excel tool (without using VBA) to perform non-routine tasks. A simplified, single-player version of the popular blackjack game was developed for this purpose.

๐Ÿค” How to play Blackjack

Object of the Game

The goal of the participant is to get as close to 21 as possible, without going over.

Card values

Whether an ace is worth 1 or 11 depends on the player. Face cards are worth 10 and any other card is worth its pip value.

The play

The player goes first and decides whether to "stand" (not ask for another card) or "hit" (ask for another card in order to reach 21). Hence, a player may stand on their two cards or ask the dealer for additional cards, one at a time, until they either decide to stand on the total (if it is under 21) or go "bust" (if it is over 21).

๐Ÿ–จ๏ธ Implementation

Manually recalculating the cells in the sheets is the main option used in the implementation of the game. This option prevents circular references between functions and performs calculations only when the user manually presses the F9 key.

There are 5 cards on each player's board, with the player starting with two cards and the dealer with one. A player's card total and corresponding win/loss message will be displayed when the F9 key is pressed.

Three sheets are in the spreadsheet

Calculations

Where all the "behind the scenes" calculations are made:

  • Shuffling th order of the cards in the pack.
  • Distribution of the cards to the dealer and the participant.
  • In each draw, the sum of the cards is calculated for each player.

The main functions of the game are:

  1. Changed Ace? which calculates whether the sum of aces should change from 11 to 1 to allow the game to continue.
  2. Sum which calculates the player's sum and whether he reached the sum of 21 and won, or exceeded it and lost (A tie between the dealer and the player is also considered a loss).

How to play

Provides a brief explanation of the game.

Blackjack

Where the game itself takes place, serves as the user interface for the game.

๐Ÿ•น๏ธ Getting Started

Dependencies

  • Microsoft Office Excel 2007, or later.

Setup

  1. Launch the Microsoft Excel spreadsheet on the Blackjack sheet.
  2. Set the "Restart" label to TRUE and the "Draw more" label to HIT.
  3. Press F9 once, then set the "Restart" label to FALSE.

How to play

  1. To draw more cards, press F9 (the "Draw more" label should be set to HIT).
  2. When you are done asking for more cards, change "Draw more" label to STAND.
  3. To find out who won, press F9 one last time (A message stating "you win/lose" will appear in the middle of the game table).

๐Ÿ“ License

Copyright ยฉ 2019, erelado All rights reserved.

This source code is licensed under the GPL-v3.0 license found in the LICENSE file in the root directory of this source tree.

ms-excel-blackjack's People

Contributors

erelado avatar

Watchers

 avatar

Forkers

gameking3001

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.