You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/learn/tutorial-tic-tac-toe.md
+22-55Lines changed: 22 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ You will build a small tic-tac-toe game during this tutorial. This tutorial does
10
10
11
11
</p>
12
12
13
-
!!! abstract "Note"
13
+
!!! note
14
14
15
15
This tutorial is designed for people who prefer to **learn by doing** and want to quickly try making something tangible. If you prefer learning each concept step by step, start with [Describing the UI.](./your-first-component.md)
16
16
@@ -53,72 +53,39 @@ Once you've played around with the finished tic-tac-toe game, keep scrolling. Yo
53
53
54
54
## Setup for the tutorial
55
55
56
-
In the live code editor below, click **Fork**in the top-right corner to open the editor in a new tab using the website CodeSandbox. CodeSandbox lets you write code in your browser and preview how your users will see the app you've created. The new tab should display an empty square and the starter code for this tutorial.
56
+
In the code example below, click **Run** to open the editor in a new tab using the website Jupyter. Jupyter lets you write code in your browser and preview how your users will see the app you've created. The new tab should display an empty square and the starter code for this tutorial.
57
57
58
-
```js
59
-
exportdefaultfunctionSquare() {
60
-
return<button className="square">X</button>;
61
-
}
62
-
```
63
58
64
-
```css
65
-
* {
66
-
box-sizing: border-box;
67
-
}
59
+
=== "app.py"
68
60
69
-
body {
70
-
font-family: sans-serif;
71
-
margin: 20px;
72
-
padding: 0;
73
-
}
61
+
```python
62
+
{% include "../../examples/python/tutorial-tic-tac-toe/setup_for_the_tutorial.py" start="# start" %}
63
+
```
74
64
75
-
.square {
76
-
background: #fff;
77
-
border: 1pxsolid#999;
78
-
float: left;
79
-
font-size: 24px;
80
-
font-weight: bold;
81
-
line-height: 34px;
82
-
height: 34px;
83
-
margin-right: -1px;
84
-
margin-top: -1px;
85
-
padding: 0;
86
-
text-align: center;
87
-
width: 34px;
88
-
}
65
+
=== "stylesheet.css"
89
66
90
-
.board-row:after {
91
-
clear: both;
92
-
content: "";
93
-
display: table;
94
-
}
67
+
```css
68
+
{% include "../../examples/css/tutorial-tic-tac-toe/setup_for_the_tutorial.css" %}
69
+
```
95
70
96
-
.status {
97
-
margin-bottom: 10px;
98
-
}
99
-
.game {
100
-
display: flex;
101
-
flex-direction: row;
102
-
}
71
+
=== ":material-play: Run"
103
72
104
-
.game-info {
105
-
margin-left: 20px;
106
-
}
107
-
```
73
+
```python
74
+
# TODO
75
+
```
108
76
109
-
<Note>
77
+
!!! note
110
78
111
-
You can also follow this tutorial using your local development environment. To do this, you need to:
79
+
You can also follow this tutorial using your local development environment. To do this, you need to:
112
80
113
-
1. Install [Node.js](https://nodejs.org/en/)
114
-
1. In the CodeSandbox tab you opened earlier, press the top-left corner button to open the menu, and then choose **File > Export to ZIP** in that menu to download an archive of the files locally
115
-
1. Unzip the archive, then open a terminal and `cd` to the directory you unzipped
116
-
1. Install the dependencies with `npm install`
117
-
1. Run `npm start` to start a local server and follow the prompts to view the code running in a browser
0 commit comments