Oh yea? give me the equalent of PLAY function. Or the PSET function to turn individual pixels on and off on the screen. Give me the function to read the color of any onscreen pixel (admittantly not QBASIC but some C variant)...
FFS you can't even draw something delayed on screen without having to deal with the setTimeout, setInterval madness. That alone would kill any interest that a kid might be starting out with!
What is a `ctx` and why do I need that? These are all hacks. Graphics programming in bolted on HTML in the form of canvas. It is a horrible platform for doing fun graphics programming when compared to qbasic.
>For delays, you define "sleep" (one line) and write "await sleep(500)" inside a loop, just like with "SLEEP" in QBASIC.
Kindly provide the code for this sleep function and tell me how a beginner who is trying draw some graphics on screen is supposed to figure that.
For sleep: const sleep = (ms) => new Promise(x => setTimeout(x, ms))
then you use like, for(;;) { console.log("hello"); await sleep(1000); }
The extra you get with this is the awesome dev tools. You can try it in this very page.