frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

France's homegrown open source online office suite

https://github.com/suitenumerique
340•nar001•3h ago•170 comments

British drivers over 70 to face eye tests every three years

https://www.bbc.com/news/articles/c205nxy0p31o
80•bookofjoe•1h ago•71 comments

Start all of your commands with a comma (2009)

https://rhodesmill.org/brandon/2009/commands-with-comma/
407•theblazehen•2d ago•149 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
76•AlexeyBrin•4h ago•14 comments

First Proof

https://arxiv.org/abs/2602.05192
29•samasblack•1h ago•17 comments

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
765•klaussilveira•19h ago•239 comments

Reinforcement Learning from Human Feedback

https://arxiv.org/abs/2504.12501
49•onurkanbkrc•4h ago•3 comments

Stories from 25 Years of Software Development

https://susam.net/twenty-five-years-of-computing.html
23•vinhnx•2h ago•2 comments

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
1015•xnx•1d ago•579 comments

Coding agents have replaced every framework I used

https://blog.alaindichiappari.dev/p/software-engineering-is-back
153•alainrk•3h ago•182 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
154•jesperordrup•9h ago•56 comments

Leisure Suit Larry's Al Lowe on model trains, funny deaths and Disney

https://spillhistorie.no/2026/02/06/interview-with-sierra-veteran-al-lowe/
4•thelok•1h ago•0 comments

72M Points of Interest

https://tech.marksblogg.com/overture-places-pois.html
5•marklit•5d ago•0 comments

Software Factories and the Agentic Moment

https://factory.strongdm.ai/
8•mellosouls•1h ago•5 comments

A Fresh Look at IBM 3270 Information Display System

https://www.rs-online.com/designspark/a-fresh-look-at-ibm-3270-information-display-system
14•rbanffy•4d ago•0 comments

Unseen Footage of Atari Battlezone Arcade Cabinet Production

https://arcadeblogger.com/2026/02/02/unseen-footage-of-atari-battlezone-cabinet-production/
100•videotopia•4d ago•26 comments

Making geo joins faster with H3 indexes

https://floedb.ai/blog/how-we-made-geo-joins-400-faster-with-h3-indexes
152•matheusalmeida•2d ago•40 comments

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
260•isitcontent•19h ago•30 comments

Show HN: Kappal – CLI to Run Docker Compose YML on Kubernetes for Local Dev

https://github.com/sandys/kappal
15•sandGorgon•2d ago•3 comments

Monty: A minimal, secure Python interpreter written in Rust for use by AI

https://github.com/pydantic/monty
273•dmpetrov•19h ago•145 comments

Ga68, a GNU Algol 68 Compiler

https://fosdem.org/2026/schedule/event/PEXRTN-ga68-intro/
32•matt_d•4d ago•8 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
543•todsacerdoti•1d ago•262 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
415•ostacke•1d ago•108 comments

What Is Ruliology?

https://writings.stephenwolfram.com/2026/01/what-is-ruliology/
61•helloplanets•4d ago•60 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
361•vecti•21h ago•161 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
331•eljojo•22h ago•201 comments

An Update on Heroku

https://www.heroku.com/blog/an-update-on-heroku/
454•lstoll•1d ago•298 comments

Microsoft open-sources LiteBox, a security-focused library OS

https://github.com/microsoft/litebox
370•aktau•1d ago•194 comments

Google staff call for firm to cut ties with ICE

https://www.bbc.com/news/articles/cvgjg98vmzjo
92•tartoran•1h ago•20 comments

Cross-Region MSK Replication: K2K vs. MirrorMaker2

https://medium.com/lensesio/cross-region-msk-replication-a-comprehensive-performance-comparison-o...
7•andmarios•4d ago•1 comments
Open in hackernews

2048 with only 64 bits of state

https://github.com/izabera/bitwise-challenge-2048
173•todsacerdoti•7mo ago

Comments

meta-level•7mo ago
Wow,I have a bash script that just starts a docker container with some fancy arguments roughly the same LOC...
JoeOfTexas•7mo ago
I too am impressed with his bash script. Simple and concise.
kinduff•7mo ago
The LOC are really impressive and the implemention pretty smart. Thanks for sharing!
lotyrin•7mo ago
I was thinking "wow, how do you do that?" but then I forgot you're not dealing with any possible value between 1 and 2048 in a cell, only the powers of 2, so significantly fewer possible board states. Very cool.

I feel people often miss opportunities to map between (potentially complex, high entropy) state spaces into simple linear sequences of possible states and then either use those sequences to store the complex state data as a simple number or use the state of a system to encode data of some kind.

Like, if you use a limited 7-bit character set encoding for text and map that to a number in a sequence of possible orderings of a deck of 52 cards, you can store 32 characters (conveniently sized for passwords you might not want people to know are passwords).

carra•7mo ago
It is worth mentioning that in the original game you can choose to keep going after you reach 2048. This game had to remove that option to achieve a 64bit state. Still, a clever implementation.
enriquto•7mo ago
> keep going after you reach 2048. This game had to remove that option to achieve a 64bit state.

Since 15^16 < 2^64, you can still use a 64 bit state to reach 2^15=32768, which does not seem to be reachable in practice (the previous state would fill the whole board!)

ToValueFunfetti•7mo ago
I'm not sure how the math works out, but some googling suggests that 32768 is achievable in practice while 65536 and 131072 are theoretically possible but have only been achieved with undos.

edit: Explanation of the 131072 cap: https://puzzling.stackexchange.com/questions/48/what-is-the-...

Also, in one of the answers there someone claims to have achieved 65536 in practice

ghghgfdfgh•7mo ago
65536 has been achieved by 2 people without undos. However, it is very difficult as it’s only around a 7% chance with optimal play.

This is a partial video of one of them: https://youtube.com/watch?v=QQSLjPHg5P8

sltkr•7mo ago
You need 16^16 for 32768 because 0 is used to represent an empty tile (2^0 = 1 is not used) which is exactly equal to 2^64.

The state in this implementation also stores a random seed (between 0 and 99, exclusive), so using 16^16 for the state would leave nothing for the random seed.

nneonneo•7mo ago
Cool! I used a similar trick in my 2048 AI: https://github.com/nneonneo/2048-ai. In my case I allow the tiles to go all the way up to 32768, so I just have one tile per nybble.

Using this representation is great: it lets me pack a whole gameboard into a single machine register, which makes it super efficient. In this case I see that you’re able to pack in a seed value to enable replayability - neat!

kccqzy•7mo ago
Love the fact that you refer to your program as AI. We need more people to use AI to refer to non-LLM technologies lest the term be redefined.
enriquto•7mo ago
Total number of states = 11^16, assuming you don't reach 2048, just like you don't actually kill the king in chess.

Now log_2(11^16)=55.34, thus 56 bits are sufficient. That's tight!

nine_k•7mo ago
Encode them in CJK and combining Unicode characters, to keep the visual representation as short as possible.
eurleif•7mo ago
To me, the impressive part is implementing it in under 200 lines of bash script, not implementing it with only 64 bits of state. Nothing clever is required for 64 bits of state: a cell has 12 possible states (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, and empty), which can be expressed in 4 bits, and 4*4*4 = 64.
charcircuit•7mo ago
>a cell has 12 possible states

There is 18 states. The final possible board state is 16 increasing power of 2s starting at 4, since it's possible for a tile to spawn in as 4. Then you also need states for 2 and empty making for a total of 18.

Lerc•7mo ago
That's a special case. You could have a single bit for special case mode and then very few bits to say what happened.

Usually you can encode special states in a more compact form because the type of specialness is additional information meaning the single special bit is all you need to grow by.

A bloated form for the final state would be a bit to indicate specialness, 7 bits for specialness mode. End state mode is encoded as the turn before plus direction. So adding 10 bits in all, there's almost certainly enough in the knowledge that it is an end state to encode the board in 10 bits fewer, eliminating all expansion except for the specialness bit.

dmurray•7mo ago
It's not a special case, it's a change of the rules to allow numbers greater than 2048. Which are allowed in some implementations, but not this one.
charcircuit•7mo ago
It's the default rules.
pixelpoet•7mo ago
There are*
vikingerik•7mo ago
This is correct (if cells higher than 2048 are allowed, which varies by implementation.) But the game can still be represented in fewer than 16×18 bits, because not every board state is reachable. There can't be more than one cell with the maximum value. And if that is present, then there can't be more than one cell with the next-highest value, and so on. So you could devise some scheme to enumerate all reachable states and skip unreachable ones, and it would take fewer than 16×18 bits to indicate which one. The upper bound is at least bounded by ignoring representing the maximum value and then using 4 bits to indicate its necessarily singular position. There are also some other unreachable configurations, like if many copies of the same value are touching each other, since at least one pair of them would have been combined on the previous move.
dooglius•7mo ago
You can have cells with more than one value with the value above 2048 but below 128K, and I don't think your scheme works much in those cases. It seems like an open question as to whether there are more than 2^64 possible states without the 2048 limit.
nine_k•7mo ago
13 possible states, because the empty state is important, too. But they fit nicely into 4 bits.

It would be mildly interesting to super-package the state into the theoretically smallest possible amount of bits: 13 * 16 = 665416609183179841 possible states, which is approximately 2 * 59.2, so 60 bits would be enough, with some margin. A whole hex digit shorter!

eurleif•7mo ago
I included empty in my count.
sltkr•7mo ago
That's what the code already does. It packs 16 fields into a base 12 representation that takes up 57.36 bits and uses the remaining 6.64 bits to store a random seed between 0 and 99 (exclusive).
dmurray•7mo ago
Is that really the theoretically smallest?

I think you can prove that some states representable by your proposal are unreachable. E.g. a board with 16 2s. So there might be another bit to spare.

YurgenJurgensen•7mo ago
Although at that point, your attempts to cut the state will probably resemble a look-up table enumerating every valid board state, which obviously balloons the executable size by a large amount.
whereismyacc•7mo ago
yes but there could conceivably be better tricks to discover
shiandow•7mo ago
It ought to be possible to generate valid states ordered by total value and lexicographical order or something.

But whether that is practical is a different matter. It does allow you to unambiguously define state #5546335 with the lowest number of bits

sltkr•7mo ago
It's not quite literally the smallest, but the interesting question is what fraction of all states represent such unreachable states.
kccqzy•7mo ago
The board rotation trick is very nice to achieve the short code length!

        w) squish ;;
        a) rot; squish; rot; rot; rot ;;
        s) rot; rot; squish; rot; rot ;;
        d) rot; rot; rot; squish; rot ;;
izabera•7mo ago
thank you i was so proud of it lmao
retsibsi•7mo ago
It's the first code snippet I've read that also works as modernist poetry.
mark_undoio•7mo ago
Always fun to see what izabera has come up with - every single time I'm somewhere between delighted and terrified to see what she's made the computer do this time!
Normal_gaussian•7mo ago
YOLO install command

  curl -fsSL https://raw.githubusercontent.com/izabera/bitwise-challenge-2048/develop/2048.bash -o "$HOME/bin/2048" && chmod +x "$HOME/bin/2048" && 2048
teaearlgraycold•7mo ago
You could pin to a commit for safety
Normal_gaussian•7mo ago
Thats a fair point

    curl -fsSL https://raw.githubusercontent.com/izabera/bitwise-challenge-2048/413abf35be0f47c4947a5ebd6d581355383041e1/2048.bash -o "$HOME/bin/2048" && chmod +x "$HOME/bin/2048" && 2048
hofrogs•7mo ago
Why not

    $HOME/.local/bin
bvanderveen•7mo ago
Like others I found the concise implementation to be impressive! I have noticed a bug though. Using the "drive into the corner" strategy (I keep the high tile in the bottom left) sometimes the top left tile randomly gets a smaller value (e.g., goes from 16 -> 4) when I slide to the left.
chadrs•7mo ago
Yeah, the first few times I thought maybe I was just imagining it; but I went from STATE=7280398215952, tried to merge my 64s into the left corner and instead ended up in STATE=7280398025476; my 64s have become 4s.

Can't reproduce it exactly as it happened, but if I run `STATE=7280398215952 bash 2048.bash` and press a 8 times, the 128 always becomes a 2.

shawabawa3•7mo ago
Doesn't happen for me, i wonder if it's only on certain architectures or certain versions of bash or something
TMWNN•7mo ago
I saw it happen on bash 3.2.25.
izabera•7mo ago
thanks, i fixed it. it was only happening on bash 3.2 and i don't use a mac so i didn't see it. https://github.com/izabera/bitwise-challenge-2048/commit/73f...
rossant•7mo ago
I'd love to see a minimal C program or similar, implemented as a single function `int64 run_2048(int64 state, int input)`, which takes the current state and an input (left, right, up, down), and returns the next state. Could be an interesting code golf exercise.