Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


Twalknz72

156 posts

Master Geek


#307054 14-Sep-2023 19:48
Send private message

Hi, I'm hoping I'm posting in the right place. My son is trying to learn coding, java script. He goes to school on line for a multitude of things but this is one thing I'm struggling with helping him through. I learned basic decades ago so I have a very generalized understanding but he's looking for programs where he can run code to check it works before submitting it. I'd be most appreciative for any help please.

Thank you

Create new topic
nzkc
1571 posts

Uber Geek


  #3127922 14-Sep-2023 19:54
Send private message

For learning programming I love https://exercism.org/  Its good for learning a language, less good from some engineering practices and general concepts (e.g. object oriented programming/design etc).

 

This site works by setting you challenges. They describe the challenge and provide you with a set of tests that you need to get working. Then you submit your result. The code can be peer reviewed (and you can review other peoples code). You can even request some mentor feedback.

 

They have a JavaScript stream. I think it would be great for your son.

 

Edit: I forgot to say it comes at the low low price of free!




Twalknz72

156 posts

Master Geek


  #3127933 14-Sep-2023 20:17
Send private message


His teacher has asked that he makes sure he has one or more decisions and one or more loops in his code, plus a comment on either something that doesn't work right or something that could be improved.

I've tried working with him on this, giving him suggestions, and we managed to get a while loop functional but he's trying to add an if statement after. I hope I'm explaining it right. Basically he asks "why do you enjoy gaming" then if you hit "cancel" it comes up with "please answer" then once there is an answer it comes up with "thank you". Afterwards he would like another question say "what is 5*5" then if the answer is 25 it'll say "correct" if not I think he's trying "try again" with another blank box for you to submit your answer.

So the first part will run on it's own, "why do you enjoy gaming" but adding the second part is where it seems to be problematic, we think as trying to find a place where he can run so many lines of code seems to be a challenge.

Sorry if I'm not explaining well.

Detruire
1771 posts

Uber Geek


  #3128275 15-Sep-2023 18:54
Send private message

If you have Firefox installed, the developer console multi-line mode may be the easiest way to get started. Chrome has a developer console too, but the multi-line editor mode makes things a lot less frustrating, and I don't think Chrome has it.

 

Alternatively, a site like REPL JS or StackBlitz might be useful - REPL JS is simpler and easier to use, but doesn't support user input; while StackBlitz is more complex, but can run code in your browser, so input e.g. via window.prompt is very easy.





rm *




SirHumphreyAppleby
2844 posts

Uber Geek


  #3128279 15-Sep-2023 19:13
Send private message

It might be beneficial if you could give a bit more information about the environment - what software you are using. E.g. is this within a Web browser, or a command line application (e.g. node.js). Was this supplied, or do you need to build it?

 

You mentioned hitting "cancel" and blank boxes, which tends to suggest this is a Web thing, so it's not purely JavaScript but basic HTML as well.


Twalknz72

156 posts

Master Geek


  #3128284 15-Sep-2023 19:22
Send private message

He said he's using doing it on Google chrome, java sandbox?

When he's running the while loop a box pops up asking the question with an empty box underneath and below that is a submit and cancel button. If the cancel button is hit it pops up with the "please answer" with an empty box for you to enter your answer.

Does that help at all?

nzkc
1571 posts

Uber Geek


  #3128286 15-Sep-2023 19:26
Send private message

Another good resource for learning some aspects of coding, particularly algorithms, is ChatGPT.


SirHumphreyAppleby
2844 posts

Uber Geek


  #3128288 15-Sep-2023 19:34
Send private message

Twalknz72:
Does that help at all?

 

I believe it will. It's not my area of expertise, unfortunately.

 

I can make a suggestion for "something that could be improved", which would be to use the do... while condition instead of while, since you always need to ask for input at least once.


 
 
 

Cloud spending continues to surge globally, but most organisations haven’t made the changes necessary to maximise the value and cost-efficiency benefits of their cloud investments. Download the whitepaper From Overspend to Advantage now.
dazzanz
214 posts

Master Geek


  #3128289 15-Sep-2023 19:39
Send private message

Twalknz72:
His teacher has asked that he makes sure he has one or more decisions and one or more loops in his code, plus a comment on either something that doesn't work right or something that could be improved.

I've tried working with him on this, giving him suggestions, and we managed to get a while loop functional but he's trying to add an if statement after. I hope I'm explaining it right. Basically he asks "why do you enjoy gaming" then if you hit "cancel" it comes up with "please answer" then once there is an answer it comes up with "thank you". Afterwards he would like another question say "what is 5*5" then if the answer is 25 it'll say "correct" if not I think he's trying "try again" with another blank box for you to submit your answer.

So the first part will run on it's own, "why do you enjoy gaming" but adding the second part is where it seems to be problematic, we think as trying to find a place where he can run so many lines of code seems to be a challenge.

Sorry if I'm not explaining well.

 

 

 

Without doing it exactly as he wants - so he can still learn to problem solve while programming. Here is something that could help https://stackblitz.com/edit/js-zef7qt?file=index.js


nzkc
1571 posts

Uber Geek


  #3128314 15-Sep-2023 20:05
Send private message

If you're wanting feedback on the code directly from the Geekzone community.. why not have him upload what he has, with some screen shots ideally, to GitHub. Add a Readme.md detailing what he wants to have happen and then people can comment on it directly.


Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.