← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
path: root/nships.c
diff options
context:
space:
mode:
authorr4tss <[email protected]>2021-03-05 08:25:31 +0100
committerr4tss <[email protected]>2021-03-05 08:25:31 +0100
commit9b1f286817418eaf70c11729b4faa3d1e55538af (patch)
tree7c68cc26dbc9dd0c27f8d17810b9de780ee16f59 /nships.c
Started work on battleship game in ncurses which will be using Networking for online play
Diffstat (limited to 'nships.c')
-rw-r--r--nships.c17
1 files changed, 17 insertions, 0 deletions
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 <ncurses.h>
+
+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;
+}