CHALLENGE
How do I make an challenge?
What is a challenge? How do you make a challenge? This script and codes were developed by Milos Stankovic on 14 September 2022, Wednesday.
CHALLENGE - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CHALLENGE</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>
CHALLENGE - Script Codes JS Codes
// arrayevi sa recima
var myVerbs = [];
var myNouns = [];
var myAdjectives = [];
// ovako bi izgledalo da za svaki array pravimo posebno prompt
/*var verbsNumber = prompt("How many words?");
for(counter = 0; counter < verbsNumber; counter++){ counter2 = counter + 1; myVerbs[counter] = prompt("Your verb " + counter2 + " is:");
}
var nounsNumber = prompt("How many nouns?");
for(counter = 0; counter < nounsNumber; counter++){ counter2 = counter + 1; myNouns[counter] = prompt("Your noun " + counter + " is:");
}
var adjectivesNumber = prompt("How many adjectives?");
for(counter = 0; counter < adjectivesNumber; counter++){ counter2 = counter + 1; myAdjectives[counter] = prompt("Your verb " + counter + " is:");
}*/
// umesto toga smestimo u fju
var myInput = function(question) { var arr = []; var number = prompt(question); for(counter = 0; counter < number; counter++){ counter2 = counter + 1; arr[counter] = prompt("Your word " + counter2 + " is:"); } return arr;
};
// i koristeci tu fju, napunimo arrayeve recima
var myVerbs = myInput("How many verbs?");
var myNouns = myInput("How many nouns?");
var myAdjectives = myInput("How many adjectives?");
// podatke imamo, sad se izvrsava kod koji mesa reci
var puzzle = function(verb, noun, adjective) { var rand = function(max) { return(Math.floor(Math.random() * max) + 1); }; var checkUnique = function(str1, str2, type) { for (counter = 0; str2 == str1; counter++) { str2 = type[rand(type.length - 1)]; if(counter > 100) { return; } } return str2; }; this.verb1 = verb[rand(verb.length - 1)]; this.noun1 = noun[rand(noun.length - 1)]; this.noun2 = checkUnique(this.noun1, noun[rand(noun.length - 1)], noun); this.adjective1 = adjective[rand(adjective.length - 1)]; this.adjective2 = checkUnique(this.adjective1, adjective[rand(noun.length - 1)], adjective); return "I like to " + this.verb1 + ". My favorite " + this.noun1 + " is " + this.adjective1 + " " + this.noun2 + ". That's what makes me " + this.adjective2 + ".";
};
var sentence = puzzle(myVerbs, myNouns, myAdjectives);
// prikazujemo sta je napravljeno
console.log("HTML ", sentence);
alert(sentence);
Developer | Milos Stankovic |
Username | milstanyu |
Uploaded | September 14, 2022 |
Rating | 3 |
Size | 2,063 Kb |
Views | 50,600 |
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 |
Search Stock | 1,680 Kb |
Null and Undefined | 1,399 Kb |
Lightbox | 2,798 Kb |
Login Form | 2,838 Kb |
Responsive Menu | 2,539 Kb |
Operators | 2,079 Kb |
Switch | 1,759 Kb |
FUNCTIONS Intro | 2,261 Kb |
Color Guess Game | 2,795 Kb |
While loop that show n random numbers | 1,434 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 |
Commuter Line Tokyu 8500 | Pedox | 7,031 Kb |
Simple Accordion | Wearebold | 3,683 Kb |
Mega Menu by Joni | Asakasinsky | 3,171 Kb |
Learning canvas drawing | Aurer | 2,204 Kb |
3D-box | Parthviroja | 2,346 Kb |
Iron Man SVG Loading Animation | Andythayer | 3,069 Kb |
Easing | GreenSock | 2,043 Kb |
Out of the blue | Giaco | 2,537 Kb |
Random Gradients - JS | Aldlevine | 2,026 Kb |
A Pen by Mike Otis | Mikeotis | 3,185 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!