Skip to content

Commit b508d13

Browse files
committed
Add zip files for chapters that need background code
To make it easy to run them locally. Add links to such files to the sandbox page.
1 parent 4dab9e3 commit b508d13

24 files changed

+141
-59
lines changed

00_intro.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:next_link: 01_values
2-
:load_files: ["js/intro.js"]
2+
:load_files: ["code/intro.js"]
33

44
= Introduction =
55

04_data.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
:prev_link: 03_functions
33
:next_link: 05_higher_order
44
:load_files: ["code/jacques_journal.js", "code/chapter/04_data.js"]
5+
:zip: node/html
56

67
= Data Structures: Objects and Arrays =
78

05_higher_order.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
:chap_num: 5
22
:prev_link: 04_data
33
:next_link: 06_object
4-
:load_files: ["code/ancestry.js", "code/chapter/05_higher_order.js", "js/intro.js"]
4+
:load_files: ["code/ancestry.js", "code/chapter/05_higher_order.js", "code/intro.js"]
5+
:zip: node/html
56

67
= Higher-Order Functions =
78

06_object.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
:prev_link: 05_higher_order
33
:next_link: 07_elife
44
:load_files: ["code/mountains.js", "code/chapter/06_object.js"]
5+
:zip: node/html
56

67
= The Secret Life of Objects =
78

07_elife.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
:chap_num: 7
22
:prev_link: 06_object
33
:next_link: 08_error
4-
:load_files: ["code/chapter/07_elife.js", "js/animateworld.js"]
4+
:load_files: ["code/chapter/07_elife.js", "code/animateworld.js"]
5+
:zip: html
56

67
= Project: Electronic Life =
78

10_modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:chap_num: 10
22
:prev_link: 09_regexp
33
:next_link: 11_language
4-
:load_files: ["code/chapter/10_modules.js", "js/loadfile.js"]
4+
:load_files: ["code/chapter/10_modules.js", "code/loadfile.js"]
55

66
= Modules =
77

11_language.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
:prev_link: 10_modules
33
:next_link: 12_browser
44
:load_files: ["code/chapter/11_language.js"]
5+
:zip: node/html
56

67
= Project: A Programming Language =
78

15_game.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
:prev_link: 14_event
33
:next_link: 16_canvas
44
:load_files: ["code/chapter/15_game.js", "code/game_levels.js"]
5+
:zip: html include=["css/game.css"]
56

67
= Project: A Platform Game =
78

@@ -1212,9 +1213,11 @@ This page feeds them to `runGame`, starting an actual game:
12121213
----
12131214
<link rel="stylesheet" href="css/game.css">
12141215

1215-
<script>
1216-
runGame(GAME_LEVELS, DOMDisplay);
1217-
</script>
1216+
<body>
1217+
<script>
1218+
runGame(GAME_LEVELS, DOMDisplay);
1219+
</script>
1220+
</body>
12181221
----
12191222

12201223
ifdef::interactive_target[]
@@ -1244,6 +1247,7 @@ ifdef::interactive_target[]
12441247
----
12451248
<link rel="stylesheet" href="css/game.css">
12461249

1250+
<body>
12471251
<script>
12481252
// The old runGame function. Modify it...
12491253
function runGame(plans, Display) {
@@ -1261,6 +1265,7 @@ ifdef::interactive_target[]
12611265
}
12621266
runGame(GAME_LEVELS, DOMDisplay);
12631267
</script>
1268+
</body>
12641269
----
12651270

12661271
endif::interactive_target[]
@@ -1317,6 +1322,7 @@ ifdef::interactive_target[]
13171322
----
13181323
<link rel="stylesheet" href="css/game.css">
13191324

1325+
<body>
13201326
<script>
13211327
// The old runLevel function. Modify this...
13221328
function runLevel(level, Display, andThen) {
@@ -1334,6 +1340,7 @@ ifdef::interactive_target[]
13341340
}
13351341
runGame(GAME_LEVELS, DOMDisplay);
13361342
</script>
1343+
</body>
13371344
----
13381345

13391346
endif::interactive_target[]

16_canvas.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
:prev_link: 15_game
33
:next_link: 17_http
44
:load_files: ["code/chapter/15_game.js", "code/game_levels.js", "code/chapter/16_canvas.js"]
5+
:zip: html include=["img/player.png", "img/sprites.png"]
56

67
= Drawing on Canvas =
78

17_http.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:chap_num: 17
22
:prev_link: 16_canvas
33
:next_link: 18_forms
4-
:load_files: ["code/chapter/17_http.js", "js/promise.js"]
4+
:load_files: ["code/chapter/17_http.js", "code/promise.js"]
55

66
= HTTP =
77

0 commit comments

Comments
 (0)