IFSC 3300 HW4 due W Sept. 21, 2022

Directions: Please provide the code for all questions that involve coding. Answers may be included in the body (instead of as attachments) of an email. Email to IFSC3300HW@gmail.com.

 

Do option A or option B.

Option A: buttons

A1. Conditionals.

A2. a. Demonstrate the if statement using a button.
b. Demonstrate the if else statement using a button.
c. Demonstrate the "else if" statement (an if else statement in which the else clause is another if else statement) using a button.

A3. Implement a for loop, a while loop, and a do while loop. These should involve buttons that demonstrate the loops.

A4. Modify the button styles. Here is an example: (check the source code for this button to see how it is done).

Option B: Game

Consider the early text-based computer game "Adventure." See https://www.historyofinformation.com/detail.php?id=2020. I used to play it, a long time ago. A video that is at least very short, if not perfect, is here. If you find a better video please email me to let me know. For Fall 2022 I found a free online version at grack.com/demos/adventure (caution: I didn't test it in detail). To give a hint, it started by saying I was near a building, so I typed "in building" and it moved me into the building. Then it said there were some keys and things on the floor. So, I typed "take keys." It responded with "ok." And so on - you can probably sort of see where this is going.

Make a simple game in Javascript. Don't worry, it doesn't have to be the next blockbuster on STEAM! (But we had a student who did design a blockbuster on STEAM.)