Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

50% Positive

Analyzed from 110 words in the discussion.

Trending Topics

#types#possible#operator#recently#wrote#klondike#rust#getting#frustrated#bugs

Discussion (4 Comments)Read Original on HackerNews

QuaternionsBhopabout 1 hour ago
I recently wrote klondike in Rust after getting frustrated with bugs in my friend's LLM-written version. I highly recommend it as a recreational programming exercise, the first 4 hour blitz filling out the types was a blast. Later, trying to make as many invalid moves unexpressable by the given types as possible was a fun challenge. I ended up with a 232 byte struct for the board state with all values stack-allocated. The only way to make it considerably smaller would probably be to encode card permutations.
userbinatorabout 1 hour ago
Everyone knows that the != operator is a surplus of the C language, use only the minus operator.

It's notable that on most CPUs, the comparison instruction is equivalent to a subtraction but without writing the actual result.

ares623about 1 hour ago
I thought games need GPU acceleration and React? How is this possible?
acheron41 minutes ago
Wait, he didn’t have to import 237 NPM packages?