Ask coding questions

← Back to all posts
What is the problem in the code?!
ZacPlayz (64)

This is a game in JS that just won't run; says it has a "unidentified variable", even though I had declared it... Who ever tells me the problem, and fixes it will gain 6 cycles, 5 for the answer, and 1 like cycle. BE QUICK!!
P.S. look at the JS file; in the HTML there's nothing.

Answered by PYer (3460) [earned 5 cycles]
View Answer
Commentshotnewtop
PYer (3460)

Hello there @ZacPlayz! The problem is not that any VARIABLE is not defined, but rather that the function is.

ReferenceError: createGraphics is not defined
    at /script.js:4:11

You need to create the function createGraphics if you want to be able to create variables using it. The undefined element is createGraphics not kg1.

ZacPlayz (64)

Congrats @PYer ! You earned 6 cycles!

Codemonkey51 (869)

Lolll also hacked ur quiz with a different method then everyone else :) @PYer

PYer (3460)

Have you tried creating a bot yet? @Codemonkey51

Codemonkey51 (869)

Look at ur post I commented it, you can't prevent wat I did @PYer

PYer (3460)

I saw it... @Codemonkey51 And we should comment on the other post if we want to discuss it.

Codemonkey51 (869)

... ummmm can I ask why @PYer

PYer (3460)

Just so we can talk. @Codemonkey51 I think I already have it but I am not sure...

Codemonkey51 (869)

I'm not on discord much but I'm [[REDACTED]] will delete this comment in 2 minutes @PYer

Warhawk947 (523)

@PYer no you actually eanred 8 because of me haha

PYer (3460)

Thanks @Warhawk947! I don't even know how everyone found this post.
And you earned 1 cycle!

Warhawk947 (523)

@PYer by looking for questions to farm off of obvioulsy lol

ZacPlayz (64)

he did...? @Codemonkey51 I mean like 5 for the answer and 1 for a like sooo

ZacPlayz (64)

another cycle... XD @PYer

Codemonkey51 (869)

Ye me and Warhawk upvoted :) @ZacPlayz