Better HN
topnewbestaskshowjobs
Log inSign up

oessessnex

3 karma · joined Aug 31, 2023 (3y ago) · 6 submissions

Submissions

comment 2y ago · link · parent

You don't play by checking all possible moves on every turn like a machine. It's mostly intuition based, but it takes a while before it develops.

Also there are levels to this game, the range of players that is fun to play against is kind of narrow, outside of that you either obliterate or get obliterated.

comment 2y ago · link · parent

In OCaml the integer operations are implemented using LEA instructions, and the floats are boxed. The language is not really suitable for numerical code...

comment 2y ago · link · parent

Yes, Nix doesn't actually ensure that the builds are deterministic. In fact it works just fine if they aren't. There are packages in nixpkgs that aren't reproducible: https://github.com/NixOS/nixpkgs/issues?q=is%3Aopen+is%3Aiss...

comment 3y ago · link · parent

Yes, except things mostly made by a single company, especially if it is VC founded.

comment 3y ago · link · parent

I implemented a partial generator based on the idea in my previous comment. It was quite a fun challenge.

At each step it determines the reachable squares for the given piece, that are not occupied or block past moves, and chooses one at random, then it computes the shortest path to that square. This procedure is repeated until there are no squares available.

Only pawns, knights and kings are supported so far.

https://gist.github.com/oessessnex/bc617095675da44f857216f98...

Great game btw :)

comment 3y ago · link · parent

It's even simpler than that. You can randomly generate a valid sequence of moves (i.e you are a pawn at a2, move to a3, become knight, move to ..., move to ..., become ..., ...), instead of the initial board state and that guarantees the puzzle is solvable. The only thing you need to watch out for is that you are not allowed to touch squares that appear in previous moves.