diff options
author | rodri <rgl@antares-labs.eu> | 2023-09-28 17:18:54 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-09-28 17:18:54 +0000 |
commit | 2834b114cfe13279b5742649cc655506c53dde8c (patch) | |
tree | 1119cbde5c64c09b311b27f25ab470dbd176044c /util.c | |
parent | 786f41cb2f7787933a0f939a221728b844776702 (diff) | |
download | battleship-2834b114cfe13279b5742649cc655506c53dde8c.tar.gz battleship-2834b114cfe13279b5742649cc655506c53dde8c.tar.bz2 battleship-2834b114cfe13279b5742649cc655506c53dde8c.zip |
added a border to the boards and corrected a bug when placing a ship.
the bug allowed the player to move the ship
when the cursor was outside the board in the
negative side of its rframe.
by using floor(2) instead of a cast to int
the problem is over.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -146,15 +146,15 @@ statename(int state) } int -max(int a, int b) +min(int a, int b) { - return a > b? a: b; + return a < b? a: b; } int -min(int a, int b) +max(int a, int b) { - return a < b? a: b; + return a > b? a: b; } int |