Hacker News new | ask | show | jobs
by bvanderveen 358 days 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.
1 comments

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.

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...
Doesn't happen for me, i wonder if it's only on certain architectures or certain versions of bash or something
I saw it happen on bash 3.2.25.