Commit 3eb22da5 authored by satan's avatar satan
Browse files

only cycle between unknown and ship

parent b9eef4c1
......@@ -53,13 +53,13 @@ export default {
function click(x: number, y: number) {
const old = getCell(grid, x, y);
if (old === Cell.UNKNOWN || old === Cell.WATER) {
if (old === Cell.UNKNOWN) {
setCell(grid, x, y, Cell.SHIP);
return;
}
if (old === Cell.SHIP) {
setCell(grid, x, y, Cell.WATER);
setCell(grid, x, y, Cell.UNKNOWN);
return;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment