Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Echecs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Elarouti Adam
Echecs
Commits
aadd9d7e
Commit
aadd9d7e
authored
2 months ago
by
De Brettes Thomas
Browse files
Options
Downloads
Patches
Plain Diff
Update index.js
parent
eb98b89d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/index.js
+15
-0
15 additions, 0 deletions
htdocs/index.js
with
15 additions
and
0 deletions
htdocs/index.js
+
15
−
0
View file @
aadd9d7e
...
@@ -501,12 +501,20 @@ function highlightMoves(tour,piece, row, col) {
...
@@ -501,12 +501,20 @@ function highlightMoves(tour,piece, row, col) {
}
}
}
}
if
(
row
==
0
&&
col
==
4
)
{
//position roi noir d'origine
if
(
row
==
0
&&
col
==
4
)
{
//position roi noir d'origine
<<<<<<<
Updated
upstream
if
(
board
[
0
][
3
]
===
""
&&
board
[
0
][
2
]
===
""
&&
board
[
0
][
1
]
===
""
&&
board
[
0
][
0
]
===
"
T
"
){
//rock à gauche
if
(
board
[
0
][
3
]
===
""
&&
board
[
0
][
2
]
===
""
&&
board
[
0
][
1
]
===
""
&&
board
[
0
][
0
]
===
"
T
"
){
//rock à gauche
=======
if
(
board
[
0
][
3
]
===
""
&&
board
[
0
][
2
]
===
""
&&
board
[
0
][
1
]
===
""
&&
board
[
0
][
0
]
===
"
t
"
){
//rock à gauche
>>>>>>>
Stashed
changes
let
newRow
=
row
;
let
newRow
=
row
;
let
newCol
=
2
;
let
newCol
=
2
;
moves
.
push
({
row
:
newRow
,
col
:
newCol
});
moves
.
push
({
row
:
newRow
,
col
:
newCol
});
}
}
<<<<<<<
Updated
upstream
if
(
board
[
0
][
5
]
===
""
&&
board
[
0
][
6
]
===
""
&&
board
[
0
][
7
]
===
"
T
"
){
//rock à droite
if
(
board
[
0
][
5
]
===
""
&&
board
[
0
][
6
]
===
""
&&
board
[
0
][
7
]
===
"
T
"
){
//rock à droite
=======
if
(
board
[
0
][
5
]
===
""
&&
board
[
0
][
6
]
===
""
&&
board
[
0
][
7
]
===
"
t
"
){
//rock à droite
>>>>>>>
Stashed
changes
let
newRow
=
row
;
let
newRow
=
row
;
let
newCol
=
6
;
let
newCol
=
6
;
moves
.
push
({
row
:
newRow
,
col
:
newCol
});
moves
.
push
({
row
:
newRow
,
col
:
newCol
});
...
@@ -693,11 +701,14 @@ function movePiece(piece, newRow, newCol) {
...
@@ -693,11 +701,14 @@ function movePiece(piece, newRow, newCol) {
piece
:
selectedPiece
// Nom de la pièce (ex: "pion", "tour", etc.)
piece
:
selectedPiece
// Nom de la pièce (ex: "pion", "tour", etc.)
}
}
});
});
<<<<<<<
Updated
upstream
if
(
echec
(
board
)){
if
(
echec
(
board
)){
socket
.
emit
(
'
echec
'
);
socket
.
emit
(
'
echec
'
);
}
}
=======
>>>>>>>
Stashed
changes
//Verifie si c'était un rock
//Verifie si c'était un rock
if
(
piece
.
toLowerCase
()
==
"
k
"
&&
Math
.
abs
(
newCol
-
selectedPosition
.
col
)
==
2
){
if
(
piece
.
toLowerCase
()
==
"
k
"
&&
Math
.
abs
(
newCol
-
selectedPosition
.
col
)
==
2
){
if
(
newCol
-
selectedPosition
.
col
==
2
){
//rock à droite
if
(
newCol
-
selectedPosition
.
col
==
2
){
//rock à droite
...
@@ -736,7 +747,11 @@ function movePiece(piece, newRow, newCol) {
...
@@ -736,7 +747,11 @@ function movePiece(piece, newRow, newCol) {
to
:
{
x
:
7
,
y
:
3
},
// Position d'arrivée
to
:
{
x
:
7
,
y
:
3
},
// Position d'arrivée
piece
:
"
t
"
}
piece
:
"
t
"
}
})
})
<<<<<<<
Updated
upstream
}
else
if
(
player
.
isBlackPlayer
){
}
else
if
(
player
.
isBlackPlayer
){
=======
}
else
{
>>>>>>>
Stashed
changes
board
[
0
][
3
]
=
"
T
"
board
[
0
][
3
]
=
"
T
"
board
[
0
][
0
]
=
""
board
[
0
][
0
]
=
""
socket
.
emit
(
'
roque
'
,
{
socket
.
emit
(
'
roque
'
,
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment