From 9b1f286817418eaf70c11729b4faa3d1e55538af Mon Sep 17 00:00:00 2001 From: r4tss <68610647+r4tss@users.noreply.github.com> Date: Fri, 5 Mar 2021 08:25:31 +0100 Subject: Started work on battleship game in ncurses which will be using Networking for online play --- nships.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 nships.c diff --git a/nships.c b/nships.c new file mode 100644 index 0000000..ac62fdb --- /dev/null +++ b/nships.c @@ -0,0 +1,17 @@ +#include + +struct p { + int x; + int y; +}; + +struct p rP() { + struct p p; + p.x = (rand() % (width - 2)) + 1; + if (p.x%2 == 0) { + } else { + p.x++; + } + p.y = (rand() % (height - 2)) + 1; + return p; +} -- cgit v1.2.3