diff options
| -rw-r--r-- | README.md | 27 |
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 +``` |
