← Back to ratslair.com
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
+}