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