Surn commited on
Commit
4e65519
·
1 Parent(s): a27b4fc

Update wordlist and resource locations

Browse files
MANIFEST.in ADDED
@@ -0,0 +1 @@
 
 
1
+ recursive-include battlewords/words *.txt
README.md CHANGED
@@ -48,7 +48,7 @@ BattleWords is a vocabulary learning game inspired by classic Battleship mechani
48
  ```
49
  3. Install dependencies:
50
  ```
51
- pip install -r specs/requirements.md
52
  ```
53
 
54
 
 
48
  ```
49
  3. Install dependencies:
50
  ```
51
+ uv pip install -r requirements.txt --link-mode=copy
52
  ```
53
 
54
 
battlewords.egg-info/PKG-INFO ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: battlewords
3
+ Version: 0.1.0
4
+ Summary: BattleWords vocabulary game
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: streamlit>=1.49.1
8
+
9
+ ---
10
+ title: BattleWords
11
+ emoji: 🎲
12
+ colorFrom: blue
13
+ colorTo: indigo
14
+ sdk: streamlit
15
+ sdk_version: 1.25.0
16
+ python_version: 3.10
17
+ app_file: app.py
18
+ tags:
19
+ - game
20
+ - vocabulary
21
+ - streamlit
22
+ - education
23
+ ---
24
+
25
+ # BattleWords
26
+
27
+ > **This project is used by [huggingface.co](https://huggingface.co/spaces/Surn/BattleWords) as a demonstration of interactive word games in Python.**
28
+
29
+ BattleWords is a vocabulary learning game inspired by classic Battleship mechanics. The objective is to discover hidden words on a grid, earning points for strategic guessing before all letters are revealed.
30
+
31
+ ## Features
32
+
33
+ - 12x12 grid with six hidden words (2x4-letter, 2x5-letter, 2x6-letter)
34
+ - Words placed horizontally or vertically
35
+ - Radar visualization to help locate word boundaries
36
+ - Reveal grid cells and guess words for points
37
+ - Scoring tiers: Good (34–37), Great (38–41), Fantastic (42+)
38
+ - Responsive UI built with Streamlit
39
+ - Deterministic seed support (Beta/Full)
40
+ - Keyboard navigation and guessing (Beta/Full)
41
+ - Overlapping words on shared letters (Beta)
42
+ - Daily and practice modes (Full)
43
+ - Leaderboards, persistence, and advanced features (Full)
44
+ - **Game ends when all words are guessed or all word letters are revealed**
45
+
46
+ ## Installation
47
+ 1. Clone the repository:
48
+ ```
49
+ git clone
50
+ cd battlewords
51
+ ```
52
+ 2. (Optional) Create and activate a virtual environment:
53
+ ```
54
+ python -m venv venv
55
+ source venv/bin/activate # On Windows use `venv\Scripts\activate`
56
+ ```
57
+ 3. Install dependencies:
58
+ ```
59
+ pip install -r specs/requirements.md
60
+ ```
61
+
62
+
63
+ ## Running BattleWords
64
+
65
+ You can run the app locally using either [uv](https://github.com/astral-sh/uv) or Streamlit directly:
66
+
67
+ ```
68
+ uv run streamlit run app.py
69
+ ```
70
+
71
+ or
72
+ ```
73
+ streamlit run app.py
74
+ ```
75
+
76
+ ## Folder Structure
77
+
78
+ - `app.py` – Streamlit entry point
79
+ - `battlewords/` – Python package
80
+ - `models.py` – data models and types
81
+ - `word_loader.py` – word list loading and validation
82
+ - `generator.py` – word placement logic
83
+ - `logic.py` – game mechanics (reveal, guess, scoring)
84
+ - `ui.py` – Streamlit UI composition
85
+ - `words/wordlist.txt` – candidate words
86
+ - `specs/` – documentation (`specs.md`, `requirements.md`)
87
+ - `tests/` – unit tests
88
+
89
+ ## How to Play
90
+
91
+ 1. Click grid squares to reveal letters or empty spaces.
92
+ 2. After revealing a letter, enter a guess for a word in the text box.
93
+ 3. Earn points for correct guesses and bonus points for unrevealed letters.
94
+ 4. **The game ends when all six words are found or all word letters are revealed. Your score tier is displayed.**
95
+
96
+ ## Development Phases
97
+
98
+ - **Proof of Concept (0.1.0):** No overlaps, basic UI, single session.
99
+ - **Beta (0.5.0):** Overlaps allowed on shared letters, responsive layout, keyboard support, deterministic seed.
100
+ - **Full (1.0.0):** Enhanced UX, persistence, leaderboards, daily/practice modes, advanced features.
101
+
102
+ See `specs/requirements.md` and `specs/specs.md` for full details and roadmap.
103
+
104
+ ## License
105
+
106
+ BattlewordsTM. All Rights Reserved. All content, trademarks and logos are copyrighted by the owner.
107
+
108
+ ## Hugging Face Spaces Configuration
109
+
110
+ BattleWords is deployable as a Hugging Face Space. To configure your Space, add a YAML block at the top of your `README.md`:
111
+
112
+ ```yaml
113
+ ---
114
+ title: BattleWords
115
+ emoji: 🎲
116
+ colorFrom: blue
117
+ colorTo: indigo
118
+ sdk: streamlit
119
+ sdk_version: 1.25.0
120
+ python_version: 3.10
121
+ app_file: app.py
122
+ tags:
123
+ - game
124
+ - vocabulary
125
+ - streamlit
126
+ - education
127
+ ---
128
+ ```
129
+
130
+ **Key parameters:**
131
+ - `title`, `emoji`, `colorFrom`, `colorTo`: Visuals for your Space.
132
+ - `sdk`: Use `streamlit` for Streamlit apps.
133
+ - `sdk_version`: Latest supported Streamlit version.
134
+ - `python_version`: Python version (default is 3.10).
135
+ - `app_file`: Entry point for your app.
136
+ - `tags`: List of descriptive tags.
137
+
138
+ **Dependencies:**
139
+ Add a `requirements.txt` with your Python dependencies (e.g., `streamlit`, etc.).
140
+
141
+ **Port:**
142
+ Streamlit Spaces use port `8501` by default.
143
+
144
+ **Embedding:**
145
+ Spaces can be embedded in other sites using an `<iframe>`:
146
+
147
+ ```html
148
+ <iframe src="https://Surn-BattleWords.hf.space?embed=true" title="BattleWords"></iframe>
149
+ ```
150
+
151
+ For full configuration options, see [Spaces Config Reference](https://huggingface.co/docs/hub/spaces-config-reference) and [Streamlit SDK Guide](https://huggingface.co/docs/hub/spaces-sdks-streamlit).
152
+
battlewords.egg-info/SOURCES.txt ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MANIFEST.in
2
+ README.md
3
+ pyproject.toml
4
+ battlewords/__init__.py
5
+ battlewords/generator.py
6
+ battlewords/logic.py
7
+ battlewords/models.py
8
+ battlewords/ui.py
9
+ battlewords/word_loader.py
10
+ battlewords.egg-info/PKG-INFO
11
+ battlewords.egg-info/SOURCES.txt
12
+ battlewords.egg-info/dependency_links.txt
13
+ battlewords.egg-info/requires.txt
14
+ battlewords.egg-info/top_level.txt
15
+ battlewords/words/wordlist.txt
16
+ tests/test_apptest.py
17
+ tests/test_generator.py
18
+ tests/test_logic.py
battlewords.egg-info/dependency_links.txt ADDED
@@ -0,0 +1 @@
 
 
1
+
battlewords.egg-info/requires.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ streamlit>=1.49.1
battlewords.egg-info/top_level.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ battlewords
battlewords/words/wordlist.txt CHANGED
@@ -1,4 +1,4 @@
1
- # Optional: place a large AZ word list here (one word per line).
2
  # The app falls back to built-in pools if fewer than 500 words per length are found.
3
  TREE
4
  BOAT
@@ -548,4 +548,24 @@ THRIVE
548
  LOGGER
549
  BREATH
550
  DOMAIN
551
- GALAXY
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Optional: place a large AZ word list here (one word per line).
2
  # The app falls back to built-in pools if fewer than 500 words per length are found.
3
  TREE
4
  BOAT
 
548
  LOGGER
549
  BREATH
550
  DOMAIN
551
+ GALAXY
552
+ BREAD
553
+ CRANE
554
+ FLAME
555
+ GRAPE
556
+ LEMON
557
+ MARCH
558
+ NURSE
559
+ PRIZE
560
+ SHINE
561
+ TIGER
562
+ BANNER
563
+ CANDLE
564
+ FAMILY
565
+ GARDEN
566
+ JACKET
567
+ LADDER
568
+ POCKET
569
+ SILVER
570
+ TUNNEL
571
+ WINNER
pyproject.toml CHANGED
@@ -7,3 +7,17 @@ requires-python = ">=3.13"
7
  dependencies = [
8
  "streamlit>=1.49.1",
9
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  dependencies = [
8
  "streamlit>=1.49.1",
9
  ]
10
+
11
+ [build-system]
12
+ requires = ["setuptools>=61.0", "wheel"]
13
+ build-backend = "setuptools.build_meta"
14
+
15
+ [tool.setuptools]
16
+ include-package-data = true
17
+
18
+ [tool.setuptools.packages.find]
19
+ where = [""]
20
+ include = ["battlewords*"]
21
+
22
+ [tool.setuptools.package-data]
23
+ "battlewords.words" = ["*.txt"]
uv.lock CHANGED
@@ -30,7 +30,7 @@ wheels = [
30
  [[package]]
31
  name = "battlewords"
32
  version = "0.1.0"
33
- source = { virtual = "." }
34
  dependencies = [
35
  { name = "streamlit" },
36
  ]
 
30
  [[package]]
31
  name = "battlewords"
32
  version = "0.1.0"
33
+ source = { editable = "." }
34
  dependencies = [
35
  { name = "streamlit" },
36
  ]