CSD 340: The Week beginning Feb. 14
We have a test this Friday.
Have you gone to the La salle art Museum's
Africana Exhibition?
- Reading:
Review Chapters 2 and 3 in Beginning JavaScript
- Homework:
A Simple Slot Machine
- Have an array of length four that will be used for image file names
(bar.gif, cherries.gif,
lemon.gif and orange).
- Have an array of size three to hold numbers.
- Use the expression (Math.floor(Math.random() * 4)) to generate random
numbers between 0 and 3 (inclusive). It's like out die simulation code.
- (To make your code scale replace the 4 above with the length of image
file name array.)
- Use a loop to generate the three elements of your random number array
and then use these numbers to create the corresponding images. (Try not to use
if's here.)
- If the three numbers are the same, display a "you win" message and a
jackpot image.
Due Feb. 21
- Monday:
Arrays uses
ColorConverter.htm,
StateCapital.htm,
StateCapitalsearch.htm and
AlphabetizingCapitals.htm
- Wednesday:
Will code the shuffling of a deck of cards in class. Uses
DeckOfCardsGifImagesZipped.zip We wrote
Poker.htm in class which despite the name starts the game of
black jack. It uses the images that are zipped up in the above hyperlink.
- Friday:
Test!!!