-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathslides.html
99 lines (85 loc) · 2.2 KB
/
slides.html
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
<!--
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<script src="../wwwbasic.js"></script>
<script type="text/basic">
TYPE line
color AS SINGLE
posX AS SINGLE
posY AS SINGLE
text AS STRING
END TYPE
slideIndex = 0
lineIndex = 0
numberOfSlides = 0
currentSlide = 0
DIM slides(100, 32) AS line
ParseSlide:
READ color$
IF color$="---" THEN
slideIndex = slideIndex + 1
lineIndex = 0
GOTO ParseSlide
END IF
IF color$="===" THEN
numberOfSlides = slideIndex
GOTO DrawSlide
END IF
READ posX
READ posY
READ text$
slides(slideIndex, lineIndex).color = color$
slides(slideIndex, lineIndex).posX = posX
slides(slideIndex, lineIndex).posY = posY
slides(slideIndex, lineIndex).text = text$
lineIndex = lineIndex + 1
GOTO ParseSlide
DrawSlide:
CLS
FOR i = 0 to 10
COLOR slides(currentSlide, i).color
LOCATE slides(currentSlide, i).posY, slides(currentSlide, i).posX
PRINT slides(currentSlide, i).text
NEXT i
COLOR 15
LOCATE 24, 74
PRINT (currentSlide + 1) + "/" + numberOfSlides
PRINT
CheckForInput:
key$ = INKEY$
IF key$ = CHR$(0) + CHR$(75) THEN
IF currentSlide > 0 THEN
currentSlide = currentSlide - 1
GOTO DrawSlide
END IF
END IF
IF key$ = CHR$(0) + CHR$(77) THEN
IF currentSlide < numberOfSlides - 1 THEN
currentSlide = currentSlide + 1
GOTO DrawSlide
END IF
END IF
GOTO CheckForInput
DATA 14, 32, 2, Sample Slide Deck
DATA 15, 2, 4, * The slides can be formatted
DATA 13, 22, 4, formatted
DATA 15, 2, 5, * You can navigate with arrow keys
DATA ---
DATA 14, 32, 2, But Why?
DATA 15, 2, 4, * Why not!
DATA 15, 2, 5, * Slides are fun
DATA ---
DATA 14, 32, 2, QUESTIONS?
DATA ---
DATA ===
</script>