Stiil not working
This commit is contained in:
parent
ddb85b5298
commit
fcd815004c
28
README.md
Normal file
28
README.md
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
Battleship
|
||||||
|
==========
|
||||||
|
|
||||||
|
The game
|
||||||
|
--------
|
||||||
|
|
||||||
|
Long version: [see wikipedia](https://secure.wikimedia.org/wikipedia/en/wiki/Battleship_game)
|
||||||
|
|
||||||
|
* Each player starts with a fleet of 5 ships, of length 5, 4, 3, 3, and 2.
|
||||||
|
* Each player places their ships horizontally or vertically on a 10x10 grid;
|
||||||
|
this is not visible to their opponent.
|
||||||
|
* Players take turns to fire at positions on the grid, gradually revealing
|
||||||
|
where their opponent’s ships are and are not located.
|
||||||
|
* A ship is destroyed when every cell of a ship has been hit.
|
||||||
|
* The winner is the first player to destroy their opponent’s fleet.
|
||||||
|
|
||||||
|
You lose if:
|
||||||
|
|
||||||
|
* You do not place the correct number and size of ships.
|
||||||
|
* You place your fleet in impossible positions (ships overlapping or partly off
|
||||||
|
the board).
|
||||||
|
* Your code raises an exception.
|
||||||
|
* All your ships have been sunk.
|
||||||
|
|
||||||
|
|
||||||
|
How To Play
|
||||||
|
--------------
|
||||||
|
Will Add soon
|
||||||
|
|
@ -171,7 +171,7 @@ td {
|
||||||
height: 45px;
|
height: 45px;
|
||||||
background-image: url("/img/carrier-3.png");
|
background-image: url("/img/carrier-3.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 101% 101%;
|
background-size: 100% 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
}
|
}
|
||||||
|
|
@ -224,7 +224,7 @@ td {
|
||||||
height: 45px;
|
height: 45px;
|
||||||
background: url("/img/battleship-3.png");
|
background: url("/img/battleship-3.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 100% 100%;
|
background-size: 101% 101%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
|
|
||||||
|
|
@ -233,7 +233,7 @@ td {
|
||||||
#submarine-0 {
|
#submarine-0 {
|
||||||
column-width: 45px;
|
column-width: 45px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
background-image: url("/img//ubmarine-0.png");
|
background-image: url("/img//submarine-0.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 101% 101%;
|
background-size: 101% 101%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
@ -358,5 +358,5 @@ td {
|
||||||
|
|
||||||
|
|
||||||
.invisible {
|
.invisible {
|
||||||
visibility: ;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
20
index.html
20
index.html
|
|
@ -74,16 +74,16 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="headers">A</th>
|
<th class="headers">A</th>
|
||||||
<td class="player-cell" id="100"></td>
|
<td class="player-cell" id="00"></td>
|
||||||
<td class="player-cell" id="101"></td>
|
<td class="player-cell" id="01"></td>
|
||||||
<td class="player-cell" id="102"></td>
|
<td class="player-cell" id="02"></td>
|
||||||
<td class="player-cell" id="103"></td>
|
<td class="player-cell" id="03"></td>
|
||||||
<td class="player-cell" id="104"></td>
|
<td class="player-cell" id="04"></td>
|
||||||
<td class="player-cell" id="105"></td>
|
<td class="player-cell" id="05"></td>
|
||||||
<td class="player-cell" id="106"></td>
|
<td class="player-cell" id="06"></td>
|
||||||
<td class="player-cell" id="107"></td>
|
<td class="player-cell" id="07"></td>
|
||||||
<td class="player-cell" id="108"></td>
|
<td class="player-cell" id="08"></td>
|
||||||
<td class="player-cell" id="109"></td>
|
<td class="player-cell" id="09"></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
|
|
@ -797,7 +797,7 @@ function playClick() {
|
||||||
cellLeftCor.includes(this.id)
|
cellLeftCor.includes(this.id)
|
||||||
) {
|
) {
|
||||||
console.log("ship placed");
|
console.log("ship placed");
|
||||||
addShip();
|
// addShip();
|
||||||
} else if (
|
} else if (
|
||||||
clicks[0] !== this.id &&
|
clicks[0] !== this.id &&
|
||||||
!cellRighCor.includes(this.id) &&
|
!cellRighCor.includes(this.id) &&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user