Git Product home page Git Product logo

catherineisonline / pig-dice-game Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 1.1 MB

Pig dice game project made with JavaScript - an awesome challenge provided by Jonas Schmedtmann in "The Complete JavaScript Course: From Zero to Expert!" [ARCHIVED]

Home Page: https://catherineisonline.github.io/pig-dice-game/

License: MIT License

HTML 16.16% JavaScript 36.91% CSS 46.93%
javascript-game games game-dev pig-game pigdice pig-dice-game pig-dice piggame dicegame dice-rolls dice-game dice-rolling js-games js-game beginner-project jonas-schmedtmann-course

pig-dice-game's Introduction

Pig Dice Game

Live Preview

This is a web-based implementation of the classic dice game Pig, created using HTML, CSS, and vanilla JavaScript.

How to Play

The objective of the game is to be the first player to reach a total score of 100 or more points. Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player decides to "hold" and end their turn:

If the player rolls a 1, their turn ends and they receive no points for the turn. If the player rolls any other number, it is added to their turn total and they can choose to either roll again or hold. If they choose to hold, their turn total is added to their score, and the turn ends. Players can also choose to use additional rules or variations, such as requiring a minimum score to start adding to their total, playing with two or more dice, or allowing the option to "double" or "triple" their score with certain rolls.

How to Run

To run the Pig Dice Game, simply open the index.html file in a web browser. No additional installation or setup is required.

Features

This implementation of the Pig Dice Game includes the following features:

Two players take turns rolling a single die. Each player's turn total and total score are displayed. Players can choose to hold their turn total and add it to their total score. Rolling a 1 ends the player's turn and forfeits their turn total. The game automatically switches turns after each turn ends. The game ends and declares a winner when a player reaches a total score of 100 points.

pig-dice-game's People

Contributors

catherineisonline avatar

Stargazers

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