Skip to content

Commit 24cbacd

Browse files
committed
docs(learn): give the tic-tac-toe nine-squares step its own example
The step says 'number the squares so you can tell them apart' and then shows a snippet whose component is already renamed to board and whose buttons already read 1-9 -- i.e. it printed the *result* of the rename step two paragraphs before the rename was asked for, and the same file was reused for both steps. Add tutorial_tic_tac_toe/nine_squares/app.py (component still named square, rows of numbered buttons) and point the first include at it. The later include keeps pointing at board/app.py. Also clarify editor-setup: the VSCode extension is published as Pylance, which bundles Pyright -- the bullet said 'install Pyright using the extension' against a marketplace item nobody can find by that name.
1 parent 0decbc3 commit 24cbacd

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from reactpy import component, html
2+
3+
4+
# start
5+
@component
6+
def square():
7+
return html.fragment(
8+
html.div(
9+
{"className": "board-row"},
10+
html.button({"className": "square"}, "1"),
11+
html.button({"className": "square"}, "2"),
12+
html.button({"className": "square"}, "3"),
13+
),
14+
html.div(
15+
{"className": "board-row"},
16+
html.button({"className": "square"}, "4"),
17+
html.button({"className": "square"}, "5"),
18+
html.button({"className": "square"}, "6"),
19+
),
20+
html.div(
21+
{"className": "board-row"},
22+
html.button({"className": "square"}, "7"),
23+
html.button({"className": "square"}, "8"),
24+
html.button({"className": "square"}, "9"),
25+
),
26+
)

‎docs/src/learn/tutorial-tic-tac-toe.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Now copy-paste your way to nine squares and... they come out in a single line, n
134134
=== "app.py"
135135

136136
```python
137-
{% include "../../examples/tutorial_tic_tac_toe/board/app.py" start="# start" %}
137+
{% include "../../examples/tutorial_tic_tac_toe/nine_squares/app.py" start="# start" %}
138138
```
139139

140140
=== "styles.css"

0 commit comments

Comments
 (0)