This file contains 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
""" | |
Zombit infection | |
================ | |
Dr. Boolean continues to perform diabolical studies on your fellow rabbit kin, | |
and not all of it is taking place in the lab. Reports say the mad doctor has his | |
eye on infecting a rabbit in a local village with a virus that transforms | |
rabbits into zombits (zombie-rabbits)! | |
Professor Boolean is confident in the virus's ability to spread, and he will | |
only infect a single rabbit. Unfortunately, you and your fellow resistance | |
agents have no idea which rabbit will be targeted. You've been asked to predict |
This file contains 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
// Vanishes the text content of elements with a certain class in some milliseconds | |
var vanishByClassName = (function() { | |
// Returns a random integer [min, max) | |
var getRandomInt = function(min, max) { | |
return Math.floor(Math.random() * (max - min)) + min; | |
}; | |
// Returns a string with a swapped out character | |
var replaceStringCharacter = function(string, index, character) { |
This file contains 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
/* | |
* Write a javascript function to take in a String, | |
* and output "n" similar looking strings. | |
*/ | |
// Returns a number of similiar strings | |
// A similiar string: respects whitespace, capitalization, and type (number vs alpha) | |
var similarNStrings = (function() { | |
// Returns a random integer [min, max) |
This file contains 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
/* | |
* In javascript: Write a function that, given an array of integers (x), | |
* and an integer (y), returns true if any two of the integers in x add up to y. | |
* (Optional) Now, write a function that, given the above arguments and an | |
* additional integer (z), returns true if any z of the integers in x add up to y. | |
*/ | |
/* | |
* Some notes on my solution: | |
* This approach is assuming ES6 support for tail recursion. |