Hacker Newsnew | past | comments | ask | show | jobs | submit | sdkgames's commentslogin

How to play is explained here [1]

By the way you can run the games locally. Just download all files.

For the forest game you would have a local directory:

   ├── Build
   │   ├── Build_7_30_F.asm.code.unityweb
   │   ├── Build_7_30_F.asm.framework.unityweb
   │   ├── Build_7_30_F.asm.memory.unityweb
   │   ├── Build_7_30_F.data.unityweb
   │   ├── Build_7_30_F.json
   │   └── UnityLoader.js
   └── index.html
then just run the following in the directory

    python3 -m http.server
[1] https://www.youtube.com/watch?v=a74KM792gbo


And how do you download the files?


1. One can use the browser's devtools (press F12 when browsing the site) to figure out the needed files.

2. Create a list of the files (files.txt).

https://oe.tradoc.army.mil/oegames/landnav/forest/Build/Buil...

https://oe.tradoc.army.mil/oegames/landnav/forest/Build/Buil...

https://oe.tradoc.army.mil/oegames/landnav/forest/Build/Buil...

https://oe.tradoc.army.mil/oegames/landnav/forest/Build/Buil...

https://oe.tradoc.army.mil/oegames/landnav/forest/Build/Buil...

https://oe.tradoc.army.mil/oegames/landnav/forest/Build/Unit...

https://oe.tradoc.army.mil/oegames/landnav/forest/index.html

3. Download the files using the browser or a downloader:

      wget --input-file=files.txt --show-progress --directory-prefix=forest --force-directories


The old version [0] has the correct layout.

[0] https://web.archive.org/web/20221010031002/https://www.trito...


When someone queried Harley-Davidson bikers as to why they don't socialize with youngsters who are avid about the latest racing motorcycles, their response was, "Why should we bother? Every year, they have something new.

--

All jokes aside, check out these cool quotes about C++ from Linus Torvalds [0] and Ken Thompson [1] ;)

[0] https://en.wikiquote.org/wiki/Linus_Torvalds

[1] https://en.wikiquote.org/wiki/Ken_Thompson


Yeah, Linus is a funny guy, as Rust allows one to be as creative as with C++, but apparently he doesn't have an issue with that.

Also maybe Harley shouldn't adopt top e-motorbikes with electronics then, like Livewire.


If I understand correctly, it's WebSocket on top of Embedded C/C++ web server (civetweb).

Also, the application must find and launch the installed browser. In my opinion, this part is very fragile. On my system, this function (webui/src/webui.c) :

   static bool _webui_browser_exist(_webui_window_t * win, size_t browser);
cannot find my browser.


Agree finding browsers can be tricky, but the node Chrome-launcher package has a fairly good approach that you can patch and extend to the other vendors.

In graderjs i solve this by searching for the installed browser, and then prompting the user to download it —obviously just the first time! — if we couldn’t find it. so the download and install happens as part of the application start up process and it’s baked into the framework. I think it’s a nice solution where the application installs any components that might need.

I think another nice solution would be to use playwright because that usually downloads all browsers that you might want and I’m sure that can be customized. playwright is a reliable source and it’ll put them in a location that easy to find.


Do you have "open URLs with a browswer" turned off in your OS? Because that's the universal way to open "whatever the user has set as their default browser".


> Do you have "open URLs with a browswer" turned off in your OS?

But the application works differently. It needs the browser in kiosk mode, which means it should be able to run the browser binary with specific arguments.


The default browser on MacOS is often safari, which is not supported (yet) according to the docs.


civetweb will run cross platform as a http server.

the issue is when you need write code on each OS, e.g. a cgi for windows/macos/linux/bsd, you will have to know the native API for each OS and use them, which could be hard to maintain if cross-platform is a must.

I wish there is something lower level that is truly cross platform, e.g. a C library runs on each OS and let me do filesystem/network/etc, it does not seem exist.


> a C library runs on each OS and let me do filesystem/network/etc, it does not seem exist.

Uh, stdlib and friends? No?


>The program is smaller than even the 'compressed' form of its output,

>and thus represents a new departure in text compression standards.

7z and gzip disagree with this statement.


It's only "compressed" if it was made by compress(1) in France. Otherwise it's just sparkling entropy coding.

For reference:

    1490 xmas-with-leading-comment.c
     913 xmas-without-leading-comment.c
    2357 xmas.out
    1297 xmas.out.9.Z
    1038 xmas.out.10.Z # actually better than with more bits!
    1048 xmas.out.11.Z # compression with 11..16 bits have the same size
     319 xmas.out.1.gz # compression levels 1..2 has same size
     317 xmas.out.3.gz
     307 xmas.out.4.gz # compression levels 4..9 have same size
Note that despite looking hard I haven't found a version of `compress` that supports `-H`, which is referenced and decompressable by gzip. I'm not sure how common it was in the wild.


  % gcc xmas.c
  xmas.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
      2 | main(t,_,a)
        | ^~~~
  xmas.c: In function 'main':
  xmas.c:2:1: warning: type of 't' defaults to 'int' [-Wimplicit-int]
  xmas.c:2:1: warning: type of '_' defaults to 'int' [-Wimplicit-int]


  % wc -c <xmas.c
  913
  % ./a.out | wc -c
  2359
  % ./a.out | compress | wc -c
  1048


zstd -19 compresses the text of the song to 309 bytes.

To be a fair comparison, though, you'd have to write zstd -d in 604 bytes. I suppose to be REALLY fair, though, you have to count the bytes of code in the compiler itself. A convenient enough implementation of compression could index into the C compiler binary to find the bytes it needs. (For example, my GCC contains "first", "second", and "third" in the binary, which a sufficiently clever implementation could make use of. "Exit on the first error occurred.", "Append a second underscore if the name already contains an underscore.", "Warn about suspicious calls to memset where the third argument is constant literal zero and the second is not.", etc. I didn't check but I doubt turtle doves or maids-a-milking come up that often in the description of warning flags.)


zstd didn't exist in 1988.


This article was posted to HN today, in 2023!


And that comment was clearly written in 1988. I fail to see what's so hard to understand about that and why people feel the need to "prove" it's "wrong".


I don't think people are trying to prove it's wrong. Most of the comments are saying that general purpose technology in 2023 doesn't reduce the file size by as much as the manual job in 1988 did.


This particular entry to the IOCCC was for 1988, those two algorithms didn’t come about for a few more years after that, gzip in the early nineties and 7z later that decade. The note is probably correct when comparing against the state of the art at the time.


You are right. Here is the source of "compress" that existed at that time. It compresses the produced song to 1048 bytes, not less.

https://www.nic.funet.fi/index/minix/compress.c

The program that produces the song, without the introductory comment, is 913 bytes, as presented in the article. Removing whitespaces it uses just 800 bytes and produces the song which is 2359 chars here. The whole C is:

    main(t,_,a)char*a;{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
    main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==
    2?_<13?main(2,_+1,"%s%d%d\n"):9:16:t<0?t<-72?main(_,t,
    "@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#;\
    #q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/+k#;\
    q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# ){nl]!/n{n#'; \
    r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
    \
    n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;\
    {nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
    #'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
    :t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1):
    0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,
    "!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}
It compiles and links even without #include.


gzip is based on the DEFLATE algorithm, which is a combination of LZ77(1977) and Huffman coding(1952).( https://en.wikipedia.org/wiki/Gzip )


DEFLATE was created / implemented / speced / whatever word you want to apply by Phil Katz no earlier than 1989


"Based on" is not the same as "identical".


Since the word 'compressed' is in quotes they are probably suggesting that they mean when processed by the 'compress' command as available on UNIX at the time, as opposed to some other compression available at the time.


I just checked, gzip is from 1992, 7z from 1999.


The program was written in 1988. I ran the text through LZSS which was published in 1982, so was available before 1988. I used a 1989 public domain version by Haruhiko Okumura, which is after 1988, but I don't believe it is optimized to improve upon the compression level of the 1982 algorithm.

It took it from 2357 bytes to 534 bytes, which is smaller than the Xmas.c program which I counted as 917 bytes, but another poster counted 913 bytes.


"New departure" simply doesn't mean "record-breaking compression ratio".


Auktyon (a Russian alternative rock band) has an album of songs based on poems by Russian futurist Velimir Khlebnikov. [1]

[1] https://www.youtube.com/watch?v=YFDBG7sGDRU


if you have fmt (a console program from coreutils, on Linux it's usually preinstalled) then

1) mark your lines (Shift+v then move your cursor)

2) press ':'

3) '<,'> !fmt -w 80

In the similar way I also use column to format text.



The only effective way to raise the confidence level of a program significantly is to give a convincing proof of its correctness. [0]

Edsger W. Dijkstra

CONTEXT:

Argument three is based on the constructive approach to the problem of program correctness. Today a usual technique is to make a program and then to test it. But: program testing can be a very effective way to show the presence of bugs, but is hopelessly inadequate for showing their absence. The only effective way to raise the confidence level of a program significantly is to give a convincing proof of its correctness. But one should not first make the program and then prove its correctness, because then the requirement of providing the proof would only increase the poor programmer’s burden. On the contrary: the programmer should let correctness proof and program grow hand in hand. Argument three is essentially based on the following observation. If one first asks oneself what the structure of a convincing proof would be and, having found this, then constructs a program satisfying this proof’s requirements, then these correctness concerns turn out to be a very effective heuristic guidance. By definition this approach is only applicable when we restrict ourselves to intellectually manageable programs, but it provides us with effective means for finding a satisfactory one among these.

[0] Edsger Dijkstra - Turing Award Lecture - The Humble Programmer - 1972

https://www.cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340...


Is this about Design by contract? [0] But why do they force students to use an imperative language?

[0] https://en.wikipedia.org/wiki/Design_by_contract


It's not about generating code from contracts, it's about formally verifying that the associated C0 code satisfies those contracts.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: