1
Fork 0
mirror of https://github.com/RGBCube/Site synced 2025-07-30 12:37:50 +00:00

blog(nix-iceberg): explain tic tac toe in nix repl

This commit is contained in:
RGBCube 2025-06-07 02:30:54 +03:00
parent 8b9c5cea4a
commit 14f5ba5345
Signed by: RGBCube
SSH key fingerprint: SHA256:CzqbPcfwt+GxFYNnFVCqoN5Itn4YFrshg1TrnACpA5M

View file

@ -1108,7 +1108,26 @@ instead of `builtins.break` itself.
## multiplayer tic-tac-toe in nix repl
TODO
You want to read this blog post:
[Are Nix Expressions Pacman-Complete?](https://stuebinm.eu/posts/nix-tic-tac-toe-complete.html)
You can run it using the following bash/zsh/etc (any shell that implements
`$(( RANDOM ))`):
```sh
git clone https://stuebinm.eu/git/playground nix-tic-tac-toe
# In first shell:
nix-build --argstr seed $(( RANDOM )) nix-tic-tac-toe/nix-turing/game.nix
# In second shell, in parallel:
move=0
while true; do
read -p "move: " content
echo "$content" > "/tmp/input-${move}"
((move++))
done
```
## `let e="e"; in [001.2e01e.30.4]`