File tree 3 files changed +10
-8
lines changed
3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,10 @@ greetings instead:
79
79
```
80
80
81
81
What happens here exactly? Everything that you list between ` πΏ ` and ` π ` is made
82
- into a list. And ` β‘οΈ ` is used to create a constant variable. Maybe this appears
83
- odd at first, but in Emojicode the value for a variable is on the left-hand-side
84
- of ` β‘οΈ ` and the variable name on the right-hand-side.
82
+ into a list, which is represented by an instance of type π¨. The ` β‘οΈ ` operator is
83
+ used to create a constant variable. Maybe this appears odd at first, but in
84
+ Emojicode the value for a variable is on the left-hand-side of ` β‘οΈ ` and the
85
+ variable name on the right-hand-side.
85
86
86
87
Next, we want to print the first greeting in that list as a test:
87
88
@@ -148,8 +149,9 @@ Weβll start off by creating a dictionary to map languages to a greeting:
148
149
π
149
150
```
150
151
151
- ` π― ` works like π¨ and creates a dictionary from the listed values. This
152
- dictionary is stored into ` dictionary ` .
152
+ πΏ with can also be used to list key value pairs, where each key is separated
153
+ from its value with a β‘οΈ. This will create an instance of π― is stored into
154
+ ` dictionary ` . The type π― is known as dictionary or hash map in other languages.
153
155
154
156
The method to access a dictionary is also called ` π½ ` , so intuitively we would
155
157
write:
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ when the type of *iterable* declared its conformance to ππElementπ.
119
119
Letβs take a look at an example:
120
120
121
121
```
122
- π¨ π€treeπ€ π€beeπ€ π€leeπ€ π€meπ€π β‘οΈ list
122
+ πΏ π€treeπ€ π€beeπ€ π€leeπ€ π€meπ€π β‘οΈ list
123
123
124
124
π name list π
125
125
π nameβοΈ
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ following code does work and it is very desirable that it do so:
6
6
7
7
```
8
8
ππ
9
- π¨π¨ π€Aπ€ ππ β‘οΈ ππ array
9
+ πΏπΏ π€Aπ€ ππ β‘οΈ ππ array
10
10
π»π½array 0βοΈ π€Bπ€βοΈ
11
11
12
12
π π½π½array 0βοΈ1βοΈβοΈ
@@ -36,7 +36,7 @@ variable. The following program will therefore panic:
36
36
37
37
``` !
38
38
ππ
39
- π¨π¨ π€Aπ€ ππ β‘οΈ ππ array
39
+ πΏπΏ π€Aπ€ ππ β‘οΈ ππ array
40
40
π½array 0βοΈβ‘οΈ ππ subarray
41
41
π»subarray π€Bπ€βοΈ
42
42
You canβt perform that action at this time.
0 commit comments