nships
2021-03-05
Source: nships
An attempt at networked Battleship over ncurses. Host a game on a raw TCP socket or join one by IP, trade names, place your ships, then take turns firing at each other. It was my first time reaching for sockets directly instead of some higher-level networking library, and getting a host and a client to find each other and exchange turns over `accept`/`connect` felt like a real milestone.
Ship placement and turn-taking both work. You move ships around with WASD, rotate them, lock them in, and coordinates get sent back and forth so each side sees where the other is aiming. What never got finished is syncing the actual board state after placement, so a real game currently plays blind past that point. There's also a stray unresolved merge conflict still sitting in the source from whatever merge introduced it, never cleaned up. A good reminder to actually finish resolving a conflict before moving on.