Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[user]
email = e1@emergent.sh
name = E1
email =
name =
2 changes: 0 additions & 2 deletions backend/.env

This file was deleted.

25 changes: 0 additions & 25 deletions backend/requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion frontend/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
REACT_APP_BACKEND_URL=https://42902f61-f81d-4f93-8ed1-4a8abb3a8b3b.preview.emergentagent.com
WDS_SOCKET_PORT=443
3 changes: 2 additions & 1 deletion frontend/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"ignoreDeprecations": "6.0",
"paths": {
"@/*": ["src/*"]
}
},
"ignoreDeprecations": "6.0"
},
"include": ["src"]
}
19 changes: 18 additions & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
<!doctype html>
<!doctype html>
<html lang="en">
<<<<<<< HEAD
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="GameHub - A collection of classic browser games"
/>
<title>GameHub</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
=======
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand All @@ -11,4 +27,5 @@
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
>>>>>>> 5ba5d7a24af347ce938db3c693acb141f5a12858
</html>
15 changes: 15 additions & 0 deletions frontend/src/games/Checkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ const Checkers = () => {
if (!isValidSquare(newRow, newCol)) continue;

if (!boardState[newRow][newCol]) {
<<<<<<< HEAD
// Regular move to empty square
moves.push({ row: newRow, col: newCol, type: "move" });
} else if (boardState[newRow][newCol].color !== piece.color) {
// Potential capture
=======
moves.push({ row: newRow, col: newCol, type: "move" });
} else if (boardState[newRow][newCol].color !== piece.color) {
>>>>>>> 5ba5d7a24af347ce938db3c693acb141f5a12858
const jumpRow = newRow + dRow;
const jumpCol = newCol + dCol;

Expand Down Expand Up @@ -128,9 +135,13 @@ const Checkers = () => {
capturedRow = null,
capturedCol = null,
) => {
<<<<<<< HEAD
const newBoard = board.map((row) => [...row]);
=======
const newBoard = board.map((row) =>
row.map((cell) => (cell ? { ...cell } : null)),
);
>>>>>>> 5ba5d7a24af347ce938db3c693acb141f5a12858
const piece = newBoard[fromRow][fromCol];

// Move piece
Expand Down Expand Up @@ -173,7 +184,11 @@ const Checkers = () => {
} else {
// End turn
setSelectedSquare(null);
<<<<<<< HEAD
setCurrentPlayer((prev) => (prev === "red" ? "black" : "red"));
=======
setCurrentPlayer(currentPlayer === "red" ? "black" : "red");
>>>>>>> 5ba5d7a24af347ce938db3c693acb141f5a12858
setMustCapture(false);

// Check for win conditions
Expand Down
Loading