This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| background: #efefef; | |
| text-align: center; | |
| } | |
| header { | |
| max-width: 40em; | |
| margin: auto; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Medium | |
| 1. Untitled Section | |
| 1. Staff picks | |
| 2. Culture | |
| 3. Humor | |
| 4. Tech | |
| 5. Design | |
| 6. This Happened | |
| 7. I.M.H.O | |
| 8. Long Reads |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| //This version of the race introduces a new animal - 'Sandra', the garter snake. The turtle and rabbit are too big to be brought down by the snake, but a bite can still do damage. The snake will strike when it is at the same position as either of the competitors. Since Sandra is not a true competitor the race will not be deemed complete if she is the first to cross the finish line. | |
| var Animal = function(name, speed, distance) { | |
| this.name = name; | |
| this.speed = speed; | |
| this.distance = distance; | |
| this.position = 0; | |
| this.report = function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| /*The following is a guessing game where a user will be asked to guess a number between 1 and 10, which the computer will randomly generate beforehand*/ | |
| var play = prompt("Welcome to the game! You will need to correctly guess the randomly selected number between 1 and 10 in order to win. Enter in 'Yes' if you want to play or 'No' to exit."); | |
| if (play.toLowerCase() == "yes"){ | |
| var number = Math.floor(Math.random() * 10); //Generates the random number | |
| var answer = prompt("Great! Guess the number the computer has selected. Your options are from 1 to 10."); | |
| //Analyzing answer to see if it matches number |