frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Four integers are enough to write a Snake Game

https://www.andreinc.net/2022/05/01/4-integers-are-enough-to-write-a-snake-game
19•wonger_•3d ago

Comments

xandrius•6h ago
To be pedantic, 2 integer are sufficient to write every code in existence (0 and 1).
webdevver•6h ago
Damn, I thought it was literally written in 16 bytes of assembler.

it should/might/could be possible to write a snake game in something like, 30 bytes of x86 asm.

boot up real mode old school bios environment. 0xa000 is your screen, width/height with int 10.

whaleofatw2022•14m ago
There's a version of snake written in C# that runs in UEFI. That said its at least 8kb in compiled form on windows (not sure size of uefi build) [0]

[0] https://codevision.medium.com/running-c-snake-inside-uefi-df...

fouronnes3•6h ago
Coule use zero if you sleep() just the right amount of time so that when the process wakes up, the current time contains the next frame's game state. That would reduce framerate a bit though.
boothby•6h ago
I came expecting epic-tier fractran golf, was sorely disappointed.
hinterlands•2h ago
The actual claim is that you can keep the game state for a rather minimal 8x4 game board in two uint32_t, one uint64_t, and one uint_8t.

That's not the entirety of program state - stack aside, there are some loop counters that the author isn't including in the total, along with some implicit variables e.g., for keypress data.

It's a nice optimization exercise, but the result is not particularly mind-blowing to me. You could probably make it significantly more compact at the expense of readability. For one, the shape of the snake on the game board is not random: there's plenty of combinations, such as an alternating checkerboard pattern, that are physically impossible. So the shape is likely compressible.

im3w1l•2h ago
Unless you race the beam the shape will be there in graphics memory which you could read out.
zvr•2h ago
"Four 32-bit data structures are enough to write a Snake Game in a field of 32 cells" might have been a more accurate title.

In this way, "One integer is enough to write a Snake Game" (but you play in a 2x2 field).

Show HN: I wrote a "web OS" based on the Apple Lisa's UI, with 1-bit graphics

https://alpha.lisagui.com/
16•ayaros•15m ago•0 comments

Get the location of the ISS using DNS

https://shkspr.mobi/blog/2025/07/get-the-location-of-the-iss-using-dns/
194•8organicbits•6h ago•69 comments

Functions Are Vectors (2023)

https://thenumb.at/Functions-are-Vectors/
91•azeemba•3h ago•43 comments

Claude Code Pro Limit? Hack It While You Sleep

https://github.com/terryso/claude-auto-resume
50•suchuanyi•3h ago•27 comments

Hannah Cairo has solved the Mizohata-Takeuchi conjecture

https://english.elpais.com/science-tech/2025-07-01/a-17-year-old-teen-refutes-a-mathematical-conjecture-proposed-40-years-ago.html
199•leephillips•3h ago•24 comments

Collatz's Ant and Σ(n)

https://gbragafibra.github.io/2025/07/06/collatz_ant5.html
6•Fibra•1h ago•1 comments

Toys/Lag: Jerk Monitor

https://nothing.pcarrier.com/posts/lag/
24•ptramo•4h ago•18 comments

Cool People [pdf]

https://www.apa.org/pubs/journals/releases/xge-xge0001799.pdf
3•ilamont•1h ago•1 comments

Overthinking GIS (2024)

https://scottsexton.co/post/overthinking_gis/
87•todsacerdoti•10h ago•27 comments

Metriport (YC S22) is hiring engineers to improve healthcare data exchange

https://www.ycombinator.com/companies/metriport/jobs/Rn2Je8M-software-engineer
1•dgoncharov•1h ago

Serving 200M requests per day with a CGI-bin

https://simonwillison.net/2025/Jul/5/cgi-bin-performance/
260•mustache_kimono•18h ago•210 comments

Hidden interface controls that affect usability

https://interactions.acm.org/archive/view/july-august-2025/stop-hiding-my-controls-hidden-interface-controls-are-affecting-usability
522•cxr•19h ago•371 comments

Overclocking LLM Reasoning: Monitoring and Controlling LLM Thinking Path Lengths

https://royeisen.github.io/OverclockingLLMReasoning-paper/
19•limoce•5h ago•0 comments

Take Two: Eshell

http://yummymelon.com/devnull/take-two-eshell.html
93•nanna•3d ago•54 comments

What a Hacker Stole from Me

https://mynoise.net/blog.php
309•wonger_•20h ago•86 comments

Eastern Baltic cod grow much smaller than they did due to overfishing

https://www.smithsonianmag.com/smart-news/these-cod-have-been-shrinking-dramatically-for-decades-now-scientists-say-theyve-solved-the-mystery-180986920/
253•littlexsparkee•23h ago•81 comments

How to get started with Old English poetry

https://www.deadlanguagesociety.com/p/old-english-poetry
21•onthesly•1d ago•7 comments

1945 TV Console Showed Two Programs at Once

https://spectrum.ieee.org/dumont-duoscopic-tv-set
8•pseudolus•1d ago•2 comments

Reinforcement Learning from Human Feedback (RLHF) in Notebooks

https://github.com/ash80/RLHF_in_notebooks
47•ash_at_hny•4h ago•1 comments

Show HN: Pixel Art Generator Using Genetic Algorithm

https://github.com/Yutarop/ga-pixel-art
7•ponta17•3h ago•2 comments

July 5, 1687: When Newton explained why you don't float away

https://multiverseemployeehandbook.com/blog/when-newton-explained-why-you-dont-float-away/
84•TMEHpodcast•14h ago•86 comments

Building a Mac app with Claude code

https://www.indragie.com/blog/i-shipped-a-macos-app-built-entirely-by-claude-code
115•gdudeman•3h ago•70 comments

Meet Bionode

https://microship.com/meet-bionode/
20•naves•3d ago•3 comments

How to Network as an Introvert

https://aginfer.bearblog.dev/how-to-network-as-an-introvert/
307•agcat•21h ago•113 comments

'Shit in, shit out', AI is coming for agriculture, but farmers aren’t convinced

https://theconversation.com/shit-in-shit-out-ai-is-coming-for-agriculture-but-farmers-arent-convinced-259997
9•lr0•1h ago•0 comments

Development of a transputer ISA board

https://nanochess.org/transputer_board.html
59•nanochess•2d ago•8 comments

The force-feeding of AI features on an unwilling public

https://www.honest-broker.com/p/the-force-feeding-of-ai-on-an-unwilling
303•imartin2k•12h ago•269 comments

Local-first software (2019)

https://www.inkandswitch.com/essay/local-first/
793•gasull•1d ago•269 comments

Two and a Half Years in GameDev

https://smyachenkov.com/posts/two-and-half-years-in-gamedev/
69•_sJiff•5h ago•13 comments

Huawei cloned Qwen and DeepSeek models, claimed as own

https://dilemmaworks.substack.com/p/whistleblower-huawei-cloned-and-renamed
81•dworks•2h ago•39 comments