A program that takes an input and returns a list of numbers up to and including that number, replacing some with "Beep!", "Boop!", or "I'm sorry, Dave. I'm afraid I can't do that." depending on the numbers. March 30, 2018
| Spec | Input | Output |
|---|---|---|
| Program returns 0 when 0 is input | 0 | [0] |
| Program returns numbers from 0 to the input number | 3 | [0,1,2,3] |
| Program replaces the first number that contains a 0 with "Beep!" | 3 | ["Beep!",1,2,3] |
| Program replaces the first number that contains a 1 with "Boop!" | 3 | ["Beep!","Boop!",2,3] |
| Program replaces the first number that is divisible by 3 with "I'm sorry, Dave. I'm afraid I can't do that." | 3 | ["Beep!","Boop!",2,"I'm sorry, Dave. I'm afraid I can't do that."] |
| Program replaces the all numbers that contains a 0 with "Beep!" | 10 | ["Beep!","Boop!",2,"I'm sorry, Dave. I'm afraid I can't do that.",4,5,6,7,8,9,"Beep!"] |
| Program replaces the all numbers that contains a 1 with "Boop!" and overrides the "0" rule | 10 | ["Beep!","Boop!",2,"I'm sorry, Dave. I'm afraid I can't do that.",4,5,6,7,8,9,"Boop!"] |
| Program replaces the all numbers that are divisible by 3 with "I'm sorry, Dave. I'm afraid I can't do that." and overrides the "0" and "1" rules | 12 | ["Beep!","Boop!",2,"I'm sorry, Dave. I'm afraid I can't do that.",4,5,"I'm sorry, Dave. I'm afraid I can't do that.",7,8,"I'm sorry, Dave. I'm afraid I can't do that.","Boop!","Boop!","I'm sorry, Dave. I'm afraid I can't do that."] |
- Clone this repository
- Open in a browser
- No known bugs.
- HTML
- CSS
- Javascript
Email me at breatortilla@gmail.com for support
Copyright (c) 2018 Brea Clark