Completed

JavaScript HTML Yahtzee game

This project was successfully completed by MCMariano for $25 USD in a day.

Get free quotes for a project like this
Employer working
Completed by:
Project Budget
$10 - $30 USD
Completed In
1 day
Total Bids
2
Project Description

Deadline is Sunday, July 14, 2013 1 pm
Max price is $20
[url removed, login to view]

This page will simply display a title across the top (in your div name=”header” section) , and then display two buttons …

Part 1 – Yahtzee!

In the game of Yahtzee, the user rolls 5 die at once. All you have to do for this problem is to generate this event.

Note the following line of code: ([url removed, login to view]()*6) +1;

This line generates a random number (a float) between 1 and 6. So if you wanted to simulate a roll of a single die, you could store the value of this variable as:

var firstDie = ([url removed, login to view]()*6) +1;

(Be sure to include all the parentheses in this line of code.)

Of course, you’ll need to convert this to an integer.

firstDie = parseInt(firstDie);

Have a a button that says: Play Yahtzee!

You should generate 5 random numbers and output those results in an alert box.

Part 2 – Examining a roll of 2 die (25 points)

In this game, you will roll 2 die.

· If the die show a 1 and a 1, output “Snake Eyes!”

· If the sum of the die is a 7, output “Lucky 7s!”

· If the first die shows a 6 and the second die shows a 6, output “High Sixes!”

· For all others, simply output the results of the two die.

Have a page a button that says: Roll the Die!

You MUST use an if and else-if to accomplish the above. In other words, there is only a single if block in this program.

To determine if the user rolled doubles, you must use one of your logical operators (i.e. the && or the ||).

Submission Guidelines

For this assignment, you will put just about everything we’ve done so far in the course together:

· Have at least two div sections (e.g. one for each part of the assignment). Style each of these two div sections by:

o Giving a background color (different for each)

o Adding a border around each section

o Assigning a width to the div section (e.g. 400px). You will probably want to make sure and give each of the two div sections the same width.

· Make use of an external and internal stylesheet in this document. (You will note that you can not assign separate styles to different div sections in either of these locations. However, I will show you how to to do in the next module). Have at least one style in each of these sheets.

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online