This is an HTML page that uses JavaScript to make a list of numbers up to a user specified maximum. Specific numbers are replaced with specific strings.
- Any number containing 0 is replaced with "Boop"
- Any number containing 1 is replaced with "Beep"
- Any number divisible by 3 is replaced with "Dave"
Although there are numbers that meet all 3 conditions (for example, 108 contains 0, 1, and is divisible by 3) each number is only assigned one string.
Behavior | Input | Output |
---|---|---|
Counts up to a number from 0 | 5 | [0, 1, 2, 3 ,4 ,5] |
Finds 0 within a number | 20 | 0 |
Finds 1 within a number | 14 | 1 |
Finds numbers divisible by 3 | [1, 2, 3] | 3 |
Replaces numbers containing 0 with a string | 20 | "Beep!" |
Replaces numbers containing 1 with a string | 14 | "Boop!" |
Replaces numbers divisible by 3 with a string | 3 | "I'm sorry, Dave. I'm afraid I can't do that." |
- This project can be accessed here
- Clone the repository to your machine
- Open in a web browser (was made with Chrome)
No known issues.
Contact email: zte.zachary@gmail.com
- HTML
- CSS
- Bootstrap
- Javascript
- JQuery
Not needed