JavaScript rendering target
See original GitHub issueMore a question than an Issue - do we have opinions on the rendering target (and template for it) of JavaScript implementations?
I saw a few solutions in here that appear to render text into the browser on a simple HTML page (example https://github.com/coding-horror/basic-computer-games/blob/main/73 Reverse/javascript/reverse.js#L8 ).
Conversely the language selection process (https://discourse.codinghorror.com/t/updating-101-basic-computer-games-for-2021/7927/34) included the determination if a language is “scripting appropriate” by “running on the command line”, which is true for JS, if you run it against #!/usr/bin/env node
.
So I am thinking either a) don’t render it into the browser, but write ES6 for the command line OR b) we come up with some sort of template for how interacting with the browser should work.
Thoughts?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:25 (18 by maintainers)
FWIW, this is how I’ve been doing it for Super Star Trek:
Kind of hacked together, but seems to be working decently so far
With #687 we move to node.js as main target! For playing games online we have a very simple node-terminal-emulator. Here is an example:
lacagy HTML Version: https://coding-horror.github.io/basic-computer-games/57_Literature_Quiz/javascript/litquiz.html
node.js version & terminal emuilator: https://coding-horror.github.io/basic-computer-games/00_Common/javascript/WebTerminal/terminal.html#57_Literature_Quiz/javascript/litquiz.mjs