Code Monkey home page Code Monkey logo

pig-game's Introduction

Two Day Project: Pig Dice

Contributors: Manuel Raygoza Donovan Weber Ashe Urban

A game of chance!

Technologies Used

  • JavaScript
  • JQuery
  • HTML
  • CSS
  • Boostrap
  • Markdown
  • Git/hub

Description

See Brainstorm below

Link to lesson: https://www.learnhowtoprogram.com/intermediate-javascript/object-oriented-javascript/game-of-choice-two-day-project

Tests

Describe: Roll()

Test: "It should create player" Code: Expected Output: player1 = {score, lastroll

Test: "It should return random number between 1-6 when button is submitted" Code: rollDice(); Expected Output: player1 = random number between 1-6

Test: "It should add currentScore to RoundScore to find TotalScore. If currentScore is 1 is should 0 out RoundScore and not add anything to the totalScore." Code: this.roundScore; Expected Output: {currentScore, roundScore, totalScore}

Setup/Installation Requirements

  • Clone this repository to your desktop
  • Navigate to the top level of the directory
  • Open index.html in your browser

Known Bugs

  • Current score can still be 0.

License

MIT

Copyright (c) 2022 Manuel Raygoza Donovan Weber Ashe Urban

Brainstorm

Easy: Computer always stops after second roll. Hard: Computer uses strategy based on current total and rolled dice.

human player vs human player

let player1TotalScore = 0; let player2TotalScore = 0;

create a new game (like addressBook) create a object for players create player objects name: totalScore:

create function that creates a random number between 1 and 6 (math.random(1,7)) if number !=== 1, add value to currentScore if number === 1, currentScore ===0; turn over; switch player return internalTurnScore + player[?]TotalScore

create a "hold" function to add currentScore to player's totalScore reset internalTurnScore to 0 switch player

create function to check if player's score >=100 check if player's score >=100 => WINNER else keep playing

pig-game's People

Contributors

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