Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ from chess.svg import board as svg_board
|
|
| 4 |
import requests
|
| 5 |
import base64
|
| 6 |
from cairosvg import svg2png
|
|
|
|
| 7 |
|
| 8 |
# Hugging Face API details
|
| 9 |
HUGGING_FACE_API_URL = "https://api-inference.huggingface.co/models/your-model-name"
|
|
@@ -59,19 +60,4 @@ player_move = st.text_input("Enter your move in UCI format (e.g., 'e2e4'):")
|
|
| 59 |
if st.button("Submit"):
|
| 60 |
if player_move == solution:
|
| 61 |
st.success("Correct! You've found the checkmate move.")
|
| 62 |
-
st
|
| 63 |
-
else:
|
| 64 |
-
st.error("Incorrect. Try again!")
|
| 65 |
-
|
| 66 |
-
# Option to skip the puzzle
|
| 67 |
-
if st.button("Skip Puzzle"):
|
| 68 |
-
st.session_state["current_puzzle"], st.session_state["solution"] = get_puzzle()
|
| 69 |
-
st.info("Here's a new puzzle!")
|
| 70 |
-
|
| 71 |
-
st.sidebar.header("Instructions")
|
| 72 |
-
st.sidebar.write("""
|
| 73 |
-
1. A chess position is displayed on the board.
|
| 74 |
-
2. Enter your move in **UCI format** (e.g., 'e2e4' for a pawn move).
|
| 75 |
-
3. Click **Submit** to check your answer.
|
| 76 |
-
4. Use **Skip Puzzle** to get a new position.
|
| 77 |
-
""")
|
|
|
|
| 4 |
import requests
|
| 5 |
import base64
|
| 6 |
from cairosvg import svg2png
|
| 7 |
+
import random # Import the random module
|
| 8 |
|
| 9 |
# Hugging Face API details
|
| 10 |
HUGGING_FACE_API_URL = "https://api-inference.huggingface.co/models/your-model-name"
|
|
|
|
| 60 |
if st.button("Submit"):
|
| 61 |
if player_move == solution:
|
| 62 |
st.success("Correct! You've found the checkmate move.")
|
| 63 |
+
st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|