summaryrefslogtreecommitdiffstats
path: root/2023/captions/emacsconf-2023-adventure--an-orgmode-based-text-adventure-game-for-learning-the-basics-of-emacs-inside-emacs-written-in-emacs-lisp--chunghong-chan--main.vtt
blob: ef19436dca4b897f1391e85ce8b5004d225d634f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
WEBVTT captioned by sachac, checked by sachac

NOTE Introduction

00:00:00.000 --> 00:00:04.039
Hi, I'm going to give you a little demo

00:00:04.040 --> 00:00:06.439
of a project that I'm working on

00:00:06.440 --> 00:00:09.839
which is called the `orgdungeon`.

00:00:09.840 --> 00:00:16.039
As you can see here, they are just a bunch of Org files

00:00:16.040 --> 00:00:20.559
and also an Emacs Lisp file.

00:00:20.560 --> 00:00:26.799
What I found is that if you have these Org files

00:00:26.800 --> 00:00:30.919
and then you have an Emacs Lisp file as a source

00:00:30.920 --> 00:00:36.879
to control how to progress from one file to another,

00:00:36.880 --> 00:00:40.519
it will give you a game-like experience.

00:00:40.520 --> 00:00:43.479
It's like the old game Myst.

00:00:43.480 --> 00:00:46.119
It was developed with the technology

00:00:46.120 --> 00:00:48.759
HyperCard for the Macintosh.

00:00:48.760 --> 00:00:53.199
Basically, it uses a similar technology,

00:00:53.200 --> 00:00:57.559
so a similar interface to the developer

00:00:57.560 --> 00:01:01.199
who was using that technology to develop the game.

NOTE Demo

00:01:01.200 --> 00:01:03.799
Concretely, I'm going to give you

00:01:03.800 --> 00:01:08.879
a demo of how the game looks like.

00:01:08.880 --> 00:01:14.839
So, this is a very vanilla Emacs setup.

00:01:14.840 --> 00:01:18.639
Then I open up the first Org file.

00:01:18.640 --> 00:01:22.839
The Org file is just a bunch of text,

00:01:22.840 --> 00:01:25.519
but it tells you a story.

00:01:25.520 --> 00:01:27.359
So you wake up somewhere,

00:01:27.360 --> 00:01:32.599
and then there is a dog-like robot called Emi around you.

00:01:32.600 --> 00:01:37.759
And then it tells you what you should do.

00:01:37.760 --> 00:01:40.799
Following the instructions...

00:01:40.800 --> 00:01:42.719
For example, here it tells you

00:01:42.720 --> 00:01:46.239
down there is one thing called "code block,"

00:01:46.240 --> 00:01:51.359
and then you can evaluate it by pressing `C-c C-c`.

00:01:51.360 --> 00:01:53.639
Then we can just go there

00:01:53.640 --> 00:01:55.239
and then just evaluate the code block.

00:01:55.240 --> 00:02:00.239
So technically it just runs the Emacs Lisp file,

00:02:00.240 --> 00:02:04.999
because you can see here, if you load Emacs Lisp...

00:02:05.000 --> 00:02:07.159
It just evaluates that Emacs Lisp file.

00:02:07.160 --> 00:02:09.799
I can just say `C-c C-c`.

00:02:09.800 --> 00:02:12.319
Then for this one, I just say yes,

00:02:12.320 --> 00:02:16.519
and then it will jump to another file.

00:02:16.520 --> 00:02:18.759
But in the game, I call it the plane.

00:02:18.760 --> 00:02:21.039
So it jumps to another plane.

00:02:21.040 --> 00:02:24.039
Yeah, so...

00:02:24.040 --> 00:02:26.399
In the other one, it's just saying that

00:02:26.400 --> 00:02:29.879
there is a function called `emi-escape-10`.

00:02:29.880 --> 00:02:33.479
Assuming that you don't have any experience

00:02:33.480 --> 00:02:34.759
how to use Emacs,

00:02:34.760 --> 00:02:38.759
so you have no idea how to do that,

00:02:38.760 --> 00:02:41.319
but down there, it's saying that

00:02:41.320 --> 00:02:44.319
there is a key combination called `C-h f`,

00:02:44.320 --> 00:02:48.399
and it will bring up the help system.

00:02:48.400 --> 00:02:52.559
Then you can read the help file of `emi-escape-10`.

00:02:52.560 --> 00:02:55.739
So you can just do that. For example, `C-h f`

00:02:55.740 --> 00:03:02.999
and then `describe-function` `emi-escape-10` here.

00:03:03.000 --> 00:03:06.319
It will show you the help file.

00:03:06.320 --> 00:03:10.919
Then it's just saying that you can press `M-x`,

00:03:10.920 --> 00:03:13.519
and Meta usually mapped to Alt,

00:03:13.520 --> 00:03:15.079
and then yeah.

00:03:15.080 --> 00:03:18.719
Then you can just close this help file using `C-x 1`.

00:03:18.720 --> 00:03:21.399
I'm just going to do that. And then yeah...

00:03:21.400 --> 00:03:31.479
I'm just try that. `M-x` and then `emi-escape-10`.

00:03:31.480 --> 00:03:33.359
All right.

NOTE emi-escape-12

00:03:33.360 --> 00:03:36.039
So I will jump to another file.

00:03:36.040 --> 00:03:39.359
Or in the game, you jump to another plane.

00:03:39.360 --> 00:03:40.338
And now you know that

00:03:40.339 --> 00:03:44.839
there is a function called `emi-escape-12`.

00:03:44.840 --> 00:03:47.638
And yeah, you can just do that `emi`,

00:03:47.639 --> 00:03:50.399
because you learned it previously, right.

00:03:50.400 --> 00:03:52.079
`emi-escape-12`.

00:03:52.080 --> 00:03:55.119
But this time, it asks you for a password,

00:03:55.120 --> 00:03:57.799
which you probably don't know, right?

00:03:57.800 --> 00:03:59.839
If you just type in anything,

00:03:59.840 --> 00:04:02.719
it will just say incorrect password.

00:04:02.720 --> 00:04:06.359
But yeah, it's part of the learning experience

00:04:06.360 --> 00:04:07.279
because previously you learned

00:04:07.280 --> 00:04:10.319
that you should use the help file,

00:04:10.320 --> 00:04:16.199
help system to read the help file of a function,

00:04:16.200 --> 00:04:18.319
so you can just use the help file

00:04:18.320 --> 00:04:25.839
to look for the help of `emi-escape-12`.

00:04:25.840 --> 00:04:29.519
Then, yeah, the help file will say that

00:04:29.520 --> 00:04:31.239
you should enter a password,

00:04:31.240 --> 00:04:34.159
and the password is `emi`.

00:04:34.160 --> 00:04:36.439
Right. So you can just do that.

00:04:36.440 --> 00:04:42.239
Write `emi-escape-12`,

00:04:42.240 --> 00:04:47.039
and then now you know the password is `emi`. Right.

NOTE The rest of the game

00:04:47.040 --> 00:04:51.839
So you can progress along these different files,

00:04:51.840 --> 00:04:53.519
and then if you...

00:04:53.520 --> 00:04:54.639
Okay, it's like a game,

00:04:54.640 --> 00:04:57.279
but at the same time, it also teaches you

00:04:57.280 --> 00:05:01.679
something about how Emacs works.

00:05:01.680 --> 00:05:04.599
For example, like the previous one,

00:05:04.600 --> 00:05:07.279
you know how to use the help file, for example,

00:05:07.280 --> 00:05:11.519
but in the later part, you will learn how to

00:05:11.520 --> 00:05:14.279
evaluate some Emacs Lisp code

00:05:14.280 --> 00:05:17.159
and also how to write some Emacs Lisp code

00:05:17.160 --> 00:05:19.559
as well, and then you will learn

00:05:19.560 --> 00:05:23.399
the difference between interactive commands

00:05:23.400 --> 00:05:27.239
and also just ordinary functions, for example.

00:05:27.240 --> 00:05:31.399
Now, I just created a few Org files,

00:05:31.400 --> 00:05:36.439
but I'm actively adding more Org files

00:05:36.440 --> 00:05:39.599
so that we can have a complete kind of

00:05:39.600 --> 00:05:42.559
educational experience.

00:05:42.560 --> 00:05:45.639
If you want to follow along [with] this project,

00:05:45.640 --> 00:05:51.359
you can just go to my Github repository.

00:05:51.360 --> 00:05:56.539
I hope you enjoyed this little demo.

00:05:56.540 --> 00:06:03.281
Thank you.