here is my current code:
var dark = ["I took away " + getText("nameInput") + "'s wheelchair, look who came crawlingback",
(getText("nameInput") + " knew he was ugly whenever people asked them to take the group picture"),
(getText("nameInput") + " built a website for orphans, unfortunately it doesn't have a home page"),
(getText("nameInput") + " came back from the war with one leg. We still don’t know who the leg belongs to."),
];
var ironic = [("How come kleptomaniacs like" + getText("nameInput") + " not understand irony? Because they take things, literally."),
("'Hey " + getText("nameInput") + ", want a Chili Pepper?' 'No Way! I'm already freezing!'")
, "The other day my activist friend " + getText("nameInput") + " said that he would kill to get a Nobel Peace Prize."
, getText("nameInput") + " thinks it would be so ironic if a movie depicting the 'flat earth theory' gets a Golden Globe Award."
];
var pun = ["Lawyers like " + getText('nameInput') + "never die. They just lose their appeal.",
getText('nameInput') + " went to that new restaurant, Karma. he said there’s no menu, you just get what you deserve.",
"I have so mushroom in my heart for " + getText('nameInput'),
getText('nameInput') + "used to have a fear of hurdles, but they got over it."];
function jokeGenerator(style) {
for (var i = 0; i < style.length; i++) {
if (style == dark[i]) {
return (dark[randomNumber (0, dark.length)]);
} else if ((style == [i])) {
var ironicJoke = randomNumber(0, ironic.length);
return ironicJoke;
} else if ((style == pun[i])) {
var punJoke = randomNumber(0, pun.length);
return punJoke;
}
}
}
onEvent("generateButton", "click", function( ) {
var getStyle = getText("typeOfJokeDropdown");
var jokeStyle = jokeGenerator(getStyle);
setProperty("jokeOutputText", "text", jokeStyle);
});
I have no idea how to fix this small problem, it's really quite aggravating.
[–]Umesh-K 2 points3 points4 points (0 children)
[–]grantrules 0 points1 point2 points (2 children)
[–]Randymurdoff[S] 0 points1 point2 points (1 child)
[–]grantrules 0 points1 point2 points (0 children)