1
1
# zig-zag-zoe
2
2
Multiplayer TicTacToe - in Zig - using HTMX for that zero-javascript experience
3
3
4
+ Online demo here
5
+ http://zig-zag-zoe.com
6
+
7
+ .. running on a t4gnano instance on AWS (Linux ARM64, with 512MB memory )
8
+
9
+ ** Uses Zig Master 0.11-dev **
10
+
4
11
# Install
5
12
6
13
```
@@ -9,23 +16,72 @@ cd zig-zag-zoe
9
16
zig build
10
17
```
11
18
12
- # Build
19
+ # Build and Run
13
20
14
21
```
15
22
zig build
16
- ```
17
23
18
- # Run
24
+ .. or
19
25
20
- ```
21
- ./zig-out/bin/zig-zag-zoe
26
+ zig build run
22
27
```
23
28
24
29
Now point your browsers at http://localhost:3000
25
30
26
31
.. or the equivalent address on the local network
27
32
33
+
28
34
# GamePlay
29
35
30
- - Start the Game
36
+ - Set us up a new game
37
+
38
+ Choose the number of rows and columns for the grid.
39
+
40
+ Choose the number of players.
41
+
42
+ Choose the number of squares needed to win.
43
+
44
+ Choose a % chance of a Zero Wing.
45
+
46
+ Chosse a % chance to set us up the bomb.
47
+
48
+ Click START
49
+
50
+ At this point, the system will wait for all players to login - which is done by simply selecting which player to play as.
51
+
52
+ Once logged in, you will see (in real time) who we are waiting on, and watch as they all login.
53
+
54
+ Once everyone has logged in, the board is presented, and the game begins !
55
+
56
+ ## Winning the Game
57
+
58
+ Each player takes a turn, selecting an empty square to place their piece in.
59
+
60
+ IF a player gets X in a row (where X == the number of squares needed to win), then they win, and everyone else loses !
61
+
62
+ ## Zero Wing Enabled
63
+
64
+ Each turn, a player may randomly get Zero Wing Enabled. In this mode, the border of the board is printed in orange, and they can click on ANY square
65
+ (including both empty squares AND squares that has another players piece already), and it is changed to their piece.
66
+
67
+ ## Set us up the Bomb
68
+
69
+ Each turn, a player may randomly get "Someone set us up the bomb". In this mode, the border of the board is printed in red,
70
+ and when they click on an EMPTY square, then their piece is placed in that square AND all adjacent squares are emptied out.
71
+
72
+ Be careful where you click, because you just might wipe out your own pieces.
73
+
74
+ ## Bugs
75
+
76
+ There is a bug where sometimes in normal mode ... usually after the previous player had bomb mode ... then clicking on a square
77
+ seems to zap 1 other adjacent square. Maybe. Cant reproduce it yet.
78
+
79
+ I will either fix this bug, or leave it in there as a feature - rationale is that there might be some bomb residue laying around
80
+ after someone set us up the bomb.
81
+
82
+
83
+ # Whats Interesting
84
+
85
+ This code is interesting for the following reasons :
31
86
87
+ - Its all written in Zig
0 commit comments