6 ms·
This is from the same gentleman who (among other things) demonstrated that printf() is Turing complete and wrote a first person shooter in 13kB of Javascript.
by basementcat 2y ago
This is from the same gentleman who (among other things) demonstrated that printf() is Turing complete and wrote a first person shooter in 13kB of Javascript.
https://github.com/HexHive/printbf https://github.com/HexHive/printbf
https://github.com/carlini/js13k2019-yet-another-doom-clone https://github.com/carlini/js13k2019-yet-another-doom-clone
- wodenokoto 2y ago> demonstrated that printf() is Turing complete and wrote a first person shooter in ... Not gonna lie, I thought that sentence would end with the FPS being done in printf.
- teleforce 2y agoThis guy wrote tic-tac-toe in a single call to printf for IOCCC 2020 competition: https://github.com/carlini/printf-tac-toe https://github.com/carlini/printf-tac-toe
- tubs 2y agoIt’s very fun and impressive but it’s absolutely not a single call.
- rhdjebejdbd 2y agoMaybe a generous interpretation of the comment and a realisation that common language isn't always 100% precise would be better than pointless arguments about semantics. There is only a single printf written in the source code.
- tubs 2y agoThat I can agree with!
- philipwhiuk 2y agoI don't think it's an unreasonable criticism, otherwise the challenge is trivial: ``` function printg(arg) { printf(arg); } ```
- Ensorceled 2y agoThat, of course, isn't what they did.
- philipwhiuk 2y agoThey did put it in a while loop though, which, if my programming isn't completely out of date, is capable of calling the function more than once.
- paulddraper 2y agoThat is quite literally a work of art.
- ThrowawayTestr 2y ago[flagged]
- noduerme 2y agoI'm not sure how this quote applies to harmless pursuits like making and solving absurd puzzles. It's not like regex chess is going to be a weapon of mass destruction.
- albertzeyer 2y agoThe development writeup for the Doom is interesting, with many details. https://nicholas.carlini.com/writing/2019/javascript-doom-clone-13k.html https://nicholas.carlini.com/writing/2019/javascript-doom-cl... There was one month time to complete the competition. But it seems you were allowed to reuse any existing other code. Looks like this was quite fun to work on. (I feel a bit sad that I would never be able to get one month of free time to work on this now, due to family and job...)
- mock-possum 2y agoWow that’s a fascinating read, thanks for linking it!!
- kookamamie 2y ago> a first person shooter in 13kB of Javascript I was somewhat disappointed to realize they used WebGL for rendering the graphics.
- pmarreck 2y agoWhy is this disappointing?
- klibertp 2y agoThere was an earlier version of the underlying 3d engine that used only Canvas. WebGL use is justified like this: > Once I actually got that working doing all of the math by hand in JavaScript I decided that using WebGL would probably be worth it, and actually probably wasn't cheating all that much. WebGL exposes access to the GPU-enabled rendering engine through JavaScript. While it does abstract away some of the rendering, it's less than I thought---it just supports the ability to do the necessary math efficiently---so I decided this wouldn't be cheating. And fortunately, it didn't take long to reproduce the initial renderer, but this time supporting much better (and more efficient) graphics. From: https://nicholas.carlini.com/writing/2019/3d-renderer-javascript.html https://nicholas.carlini.com/writing/2019/3d-renderer-javasc...
- lxgr 2y agoThat makes sense: As far as I understand, OpenGL 2.0 and beyond don’t really provide much fixed-function/predefined logic anymore, e.g. I believe you need to provide your own vertex and pixel shaders. You could argue that rasterization itself is being taken care by the implementation, though.