News for hackers. Stuff that matters.
Re:My son (9 yrs old) used plain JavaScript to make a game, ... by drjasonharrison on Tuesday December 03, 2024 @07:11PM (#42313184)
Also, looking at the code, I don't think you use "question_array" or "answer_array". And I don't know what "utah2" means.

Sorry I'm not great at games but I like looking at code and interfaces.

Re:My son (9 yrs old) used plain JavaScript to make a game, ... by veesahni on Tuesday December 03, 2024 @10:21PM (#42314224)
Kids dad here.

Those arrays were for a past version. I nudged him towards randomly generated question/answers. That's currently dead code.

"utah2" -- haha, his variable names are sometimes not useful here. We visited Utah months before he wrote the game, so that inspired that variable name I guess! This version I wasn't nitpicking not he code as long as it worked. The bar higher for the next version.

.. and yes, spelling issues are top thing to fix for next version! At the moment, he can code better than he can spell.

Thanks for taking a peek under the hood :)

Re:My son (9 yrs old) used plain JavaScript to make a game, ... by drjasonharrison on Wednesday December 04, 2024 @06:48PM (#42323315)
"There are two hard problems in computer science: cache invalidation, naming things, and off-by-1 errors."
Re:My son (9 yrs old) used plain JavaScript to make a game, ... by sisyphus_coding on Wednesday December 04, 2024 @07:13PM (#42323469)
Haha love that :) I think I'm going to start naming my variables after my vacation destinations too to flex on my teammates ;) Keep up the great work though, I'm sending this to my 12 year old brother to get him motivated