summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramanjain1644 <[email protected]>2024-07-12 13:07:51 +0530
committeramanjain1644 <[email protected]>2024-07-12 13:07:51 +0530
commitee354fe80acadc0a8df5c34ed916b895fa10fb12 (patch)
tree757c2ead9367052ba3c28af084298d89df1f5221
parentbfa0b985607ab325117b329801eb16b37aed683c (diff)
pawn move added
-rw-r--r--.vscode/settings.json3
-rw-r--r--app.js14
-rw-r--r--index.css27
-rw-r--r--index.html13
-rw-r--r--pawns_move.js7
5 files changed, 57 insertions, 7 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..6f3a291
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "liveServer.settings.port": 5501
+} \ No newline at end of file
diff --git a/app.js b/app.js
index ebf0afc..7437c72 100644
--- a/app.js
+++ b/app.js
@@ -1,17 +1,31 @@
let board = [
+<<<<<<< Updated upstream
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
+=======
+ [0, 1, 0, 0, 0, 0, 0, 0],
+ [1, 1, 0, 0, 0, 0, 0, 0],
+ [0, 0, 1, 1, 1, 0, 0, 0],
+ [0, 0, 1, 2, 1, 0, 0, 0],
+ [0, 0, 1, 1, 1, 0, 0, 0],
+>>>>>>> Stashed changes
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
]
+<<<<<<< Updated upstream
console.log(amelia_move(board, 7, 7))
+=======
+console.log(board.length)
+
+console.log(amelia_move(board, 0,0))
+>>>>>>> Stashed changes
function pawn_move(board, y, x) {
let moves = []
diff --git a/index.css b/index.css
index 271e489..f9e40ae 100644
--- a/index.css
+++ b/index.css
@@ -1,13 +1,25 @@
+*{
+ font-size: 30px;
+ margin: 0;
+ padding: 0;
+}
+
.white{
background-color: antiquewhite;
- height: 100px;
- width: 100px;
+ height: 76px;
+ width: 76px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
.black{
- height: 100px;
- width: 100px;
- background-color: brown;
+ height: 76px;
+ width: 76px;
+ background-color: brown;
+ display: flex;
+ justify-content: center;
+ align-items: center;
}
body{
@@ -16,11 +28,12 @@ body{
display: flex;
justify-content: center;
align-items: center;
+ margin: 1px;
}
.chess-board{
- width: 800px;
- height: 800px;
+ width: 608px;
+ height: 608px;
display: grid;
grid-template-columns:repeat(8,1fr);
grid-template-rows:repeat(8,1fr);
diff --git a/index.html b/index.html
index 1ea90b2..28b1362 100644
--- a/index.html
+++ b/index.html
@@ -10,7 +10,20 @@
<body>
<div class="chess-board">
<div>
+<<<<<<< Updated upstream
<div id="a8" class="1 white"></div>
+=======
+ <div id="a8" class="1 white">R</div>
+ <div id="b8" class="2 black">P</div>
+ <div id="c8" class="3 white"></div>
+ <div id="d8" class="4 black"></div>
+ <div id="e8" class="5 white"></div>
+ <div id="f8" class="6 black"></div>
+ <div id="g8" class="7 white"></div>
+ <div id="h8" class="8 black">R</div>
+ </div>
+ <div>
+>>>>>>> Stashed changes
<div id="a7" class="2 black"></div>
<div id="a6" class="3 white"></div>
<div id="a5" class="4 black"></div>
diff --git a/pawns_move.js b/pawns_move.js
new file mode 100644
index 0000000..f304608
--- /dev/null
+++ b/pawns_move.js
@@ -0,0 +1,7 @@
+function pawn_move(board, y, x){
+ let moves =[];
+ // * if pawn at row 1 or at row 6 it has to choice
+ if(x<board.length && x >-1 && y<board.length && y>-1){
+ moves.push()
+ }
+} \ No newline at end of file