Skip to content

Instantly share code, notes, and snippets.

View Hoodgail's full-sized avatar

Drex Benjamin Hoodgail

View GitHub Profile
@Hoodgail
Hoodgail / answer.js
Last active September 16, 2020 23:25
/*
@author = Hoodgail Benjamin
@warning = the minimum percentage of a quizz with 10 questions would be 75% depending on your work or the story
*/
let sum = "When Alta was 17, her family took a vacation in Vermilion, Ohio. Alta asked some boys to play catch with her. Soon she was showing them her best fastball. The boys were so impressed that they told the town's mayor about the girl pitcher. The mayor came to watch her play. He, too, was floored.".split(" ")
let answers = ["No one treated her well.", "She was smaller than all the boys.", "She was a girl, and girls get tired faster.", "She had to play in a long skirt."]
let most_valid = []
const chunk = arr => arr.length > 2 ? [arr.slice(0, 2), ...chunk(arr.slice(2), 2)] : [arr];
answers.forEach(function(an, id){
chunk(sum).forEach(function(words){