← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdvin Jakobsson <[email protected]>2026-09-08 19:34:30 +0200
committerEdvin Jakobsson <[email protected]>2026-09-08 19:34:30 +0200
commitaa814ab5a6ba81cc84a84595e400f3c90e6aacbb (patch)
tree22f2f396c795b47bd55b5cdb72741e8afe3d45f3
parentc27d02412b9e19f4492173546afa2e6eef9148b1 (diff)
Add README
-rw-r--r--README.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..11ebebd
--- /dev/null
+++ b/README.md
@@ -0,0 +1,27 @@
+# nships
+
+An attempt at networked Battleship over ncurses — host a game on a raw TCP socket (`server.c`, a plain `socket`/`bind`/`listen`/`accept` pair on port 8888) or join one by IP, trade names, then place ships on your own board before taking turns firing at your opponent's.
+
+Ship placement works: you move a ship around with WASD, rotate it, and lock it in, five ships per side. Turn-taking mostly works too — coordinates get sent and received over the socket so each player sees where the other is aiming. What never got finished is syncing the actual board state itself: the code that's supposed to exchange each player's ship layout after placement is stubbed out as comments ("send to p1" / "recieve p1"), so a real game currently plays blind past the placement phase.
+
+Worth knowing before you try to build it: `nships.c` still has an unresolved merge-conflict block sitting in `setPlace()` (`<<<<<<< HEAD` / `=======` / `>>>>>>> origin/main`) from whatever merge originally introduced it — that history got carried over intact rather than cleaned up, so it needs a manual pick before this will compile.
+
+## Controls
+
+Ship placement:
+- `W`/`A`/`S`/`D` — move the ship
+- `R` — rotate
+- `Enter` — lock it in
+
+Firing:
+- `W`/`A`/`S`/`D` — move the cursor
+- `Enter` — fire
+
+## Building
+
+Needs ncurses. Resolve the merge conflict in `nships.c` first, then:
+
+```sh
+cc nships.c -lncurses -o nships
+./nships
+```