FizzBuzz CAPTCHA
How do I make an fizzbuzz captcha?
In response to: http://news.ycombinator.com/item?id=5267066. What is a fizzbuzz captcha? How do you make a fizzbuzz captcha? This script and codes were developed by Chad Scira on 27 August 2022, Saturday.
FizzBuzz CAPTCHA - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>FizzBuzz CAPTCHA</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>FizzBuzz CAPTCHA : <span id="status">failing</span></h1>
<p>use the function <b>log</b> to log the results</p>
<ul> <li>log the numbers from 1 to 100</li> <li>for multiples of 3 print "Fizz" instead of the number</li> <li>for multiples of 5 print "Buzz" instead of the number</li> <li>for multiples of 3 and 5 print "FizzBuzz" instead of the number</li>
</ul>
<textarea id="input">
for (var i=1; i <= 100; i++)
{ log(i);
}
</textarea>
<textarea id="output">
</textarea> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
FizzBuzz CAPTCHA - Script Codes CSS Codes
body { background: #222; width: 1050px; margin: 20px auto 0px; font-family: 'helvetica';
}
h1 { font-weight: normal; font-size: 18px; color: #6d86a0; font-family: helvetica; text-shadow: 0 0 4px #111;
}
h1 a { color: #ff088e; text-decoration: none;
}
p {
color: #ccc;
}
li { color: #888;
}
textarea { border: 1px solid #666; background: #444; width: 500px; height: 400px; color: #fff; outline: none; padding: 10px;
}
#status {
color: red;
}
#status.passed {
color: green;
}
#output { color: #91b1c2;
}
FizzBuzz CAPTCHA - Script Codes JS Codes
var $input = $('#input'), $output = $('#output'), $status = $('#status');
var correctResults = [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fizz", 19, "Buzz", "Fizz", 22, 23, "Fizz", "Buzz", 26, "Fizz", 28, 29, "FizzBuzz", 31, 32, "Fizz", 34, "Buzz", "Fizz", 37, 38, "Fizz", "Buzz", 41, "Fizz", 43, 44, "FizzBuzz", 46, 47, "Fizz", 49, "Buzz", "Fizz", 52, 53, "Fizz", "Buzz", 56, "Fizz", 58, 59, "FizzBuzz", 61, 62, "Fizz", 64, "Buzz", "Fizz", 67, 68, "Fizz", "Buzz", 71, "Fizz", 73, 74, "FizzBuzz", 76, 77, "Fizz", 79, "Buzz", "Fizz", 82, 83, "Fizz", "Buzz", 86, "Fizz", 88, 89, "FizzBuzz", 91, 92, "Fizz", 94, "Buzz", "Fizz", 97, 98, "Fizz", "Buzz"];
function processFunction () { var userFizzBuzz = new Function($input.val()); results = []; $output.val(''); try { userFizzBuzz(); } catch (error) { return console.log(error); } var failed = false; for (var i = 0; i < correctResults.length; i++) { if (correctResults[i] !== results[i]) { failed = true; break; } } if (failed) { $status[0].className = ''; $status.text('failing'); } else { $status[0].className = 'passed'; $status.text('passed'); }
}
window.results = null;
window.log = function (value) { $output.val($output.val() + value + '\n'); console.log(value); results.push(value);
};
$input.bind('change, keydown, keyup', processFunction);
processFunction();
Developer | Chad Scira |
Username | icodeforlove |
Uploaded | August 27, 2022 |
Rating | 3 |
Size | 2,568 Kb |
Views | 34,408 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
FontAwesome | 4,360 Kb |
Dippin Dots | 2,459 Kb |
Curl Request to Node Request | 3,000 Kb |
Raw Request to Requester Request | 3,112 Kb |
Delayed Follow | 2,306 Kb |
Client-side nudity detection | 6,271 Kb |
8bit Animation | 2,764 Kb |
A Pen by Chad Scira | 2,150 Kb |
Ripple Words | 3,081 Kb |
Animated 3D Text | 3,272 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Plotting Points with D3.js | Laurakelly | 31,996 Kb |
Light Switch | Bartuc | 4,933 Kb |
CSS3 Form Page Design | Rssatnam | 3,613 Kb |
LDE old privacy page | Jasonangle | 2,339 Kb |
To Do List with Delete | Mattlbrody | 2,068 Kb |
Pomodoro Clock | Osycon | 3,705 Kb |
A cube | KyleDavidE | 18,627 Kb |
Simple Buttons | Haydenmills | 1,750 Kb |
A Pen by Patrick Cox | Pcridesagain | 2,899 Kb |
Realistic Buttons | Stoypenny | 2,248 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!