diff options
| author | r4tss <[email protected]> | 2021-03-05 08:25:31 +0100 |
|---|---|---|
| committer | r4tss <[email protected]> | 2021-03-05 08:25:31 +0100 |
| commit | 9b1f286817418eaf70c11729b4faa3d1e55538af (patch) | |
| tree | 7c68cc26dbc9dd0c27f8d17810b9de780ee16f59 | |
Started work on battleship game in ncurses which will be using Networking for online play
| -rw-r--r-- | nships.c | 17 |
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; +} |
