Live data from Hacker News

This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

iczelia.net

41–50 of 93 posts

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#41
post #30
post #26

Earlier quoted context omitted.

Don't most (all?) browsers consider file:// and localhost to be secure for the sake of enabling those features? https://developer.mozilla.org/en-US/docs/Web/Security/Defens...

Unfortunately, no. CORS will block this on Chrome and Firefox. https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/COR... The security risk : https://www.mozilla.org/en-US/security/advisories/mfsa2019-2... You need a local webserver. Or bundle everything in one html file.

[deleted]

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#42

Semi-related: Windows EXE files are runnable in DOS (at least when DOS was a thing, so for Windows 3.1x or 9x), but most of the time the DOS part just prints "This program requires Microsoft Windows." and exits. An exception is regedit.exe, that one can use to import registry values even in DOS. (Huh, although, how does it do that without using Windows API?)

> Huh, although, how does it do that without using Windows API?

without knowing anything, i am going to guess that they could either directly import the same code that the windows api uses (either via knowing where the implementation code resides and load that), or even statically link the library! After all, regedit doesn't need to obey cleanliness rules that other non-first-party programs would need to - presumably, because if those registry editing api/format changes, regedit would get updated along with it!

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#43

I love the idea of applications which exist in one file which you can run anywhere. I've been working towards this with my serverless platform; you can build complex data-driven apps with just one .html file and mostly declarative HTML markup (thanks to web-components which are loaded from a remote server). With modern browser features, you don't need a bundling system. Once you do away with it; a whole universe is o…

How are you approaching the development of your single file html apps, is there any examples publicly available, sounds very interesting.

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#44

On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...

My favorite slight of hand was that all the dungeons and caves were part of a single rectangular map. Designers carved out a few specific designs, then other levels were clearly what worked with the remaining map screens available so it all fit in the space they had, with caves thrown in to take up single screen gaps.

https://ian-albert.com/games/legend_of_zelda_maps/

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#45
post #44

On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...

My favorite slight of hand was that all the dungeons and caves were part of a single rectangular map. Designers carved out a few specific designs, then other levels were clearly what worked with the remaining map screens available so it all fit in the space they had, with caves thrown in to take up single screen gaps. https://ian-albert.com/games/legend_of_zelda_maps/

And created them in somewhat recognizable shapes, e.g. eagle

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#46
post #9

Earlier quoted context omitted.

Works for me on Windows 11

Hmm, Windows 11 25H2 here as well. Redbean works so there must be something about this particular approach combined with some unknown setting on my install. Edit: Got it working, was DEP.

What's DEP?

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#48

On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...

Indeed, magic. How about the Commodore 64, there was a game (Eindeloos, Radarsoft, 1985) within 64kb that has a huge map. Someone recently (after 40 years!) extracted the map (500 screens) and the png alone is 800kb. See the story an zoom in and try finding the little heart in the map! https://adayinthelifeof.nl/2025/03/07/endless.html

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#49
post #24

On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...

Zelda 1 was 128 kB, for those wondering, and that's without any compression. Double that for the sequel.

> without any compression

Perhaps not compression as we see it today. But one could argue that tile based graphics and code based music is a form of compression. Old games used a myriad of cool tricks to get around their limitations.

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#50
post #47

The binary relies on the runtime, so yes it is nice. Forma instance, a static compiled and linked "hello world" in C on Linux is around ~785KB

> a static compiled and linked "hello world" in C on Linux is around ~785KB

Huh?

    $ musl-gcc -xc -static -Wl,-z,norelro -Wl,-z,nosectionheader -Wl,-z,noseparate-code -s - 
    int
    main(void) {
            static const char s[] = "Hello, World!\n";
            fwrite(s, (sizeof s)-1, 1, stdout);
    }
    eof
    $ ./a.out
    Hello, World!
    $ ls -l a.out
    -rwxr-xr-x 1 oguz oguz 4976 Jan 12 09:38 a.out
And if that's not enough

    $ musl-gcc -xc -static -nostdlib -fcf-protection=none -fno-asynchronous-unwind-tables -fomit-frame-pointer -Wl,-z,norelro -Wl,-z,nosectionheader -Wl,-z,noseparate-code -s - -lc 
    void
    _start(void) {
            static const char s[] = "Hello, World!\n";
            write(1, s, (sizeof s)-1);
            _exit(0);
    }
    eof
    $ ./a.out
    Hello, World!
    $ ls -l a.out
    -rwxr-xr-x 1 oguz oguz 487 Jan 12 09:58 a.out
Post reply on HN