forked from inexorabletash/jsbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
204 lines (170 loc) · 11 KB
/
index.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
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
<!DOCTYPE html>
<title>Applesoft BASIC in JavaScript</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Suppress browser compat button -->
<link rel="shortcut icon" href="favicon.ico">
<link rel="alternate" type="application/atom+xml" href="https://github.com/inexorabletash/jsbasic/commits/master.atom">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="display.css">
<script src="https://cdn.rawgit.com/inexorabletash/polyfill/v0.1.29/polyfill.min.js"></script>
<script src="https://cdn.rawgit.com/inexorabletash/polyfill/v0.1.29/keyboard.js"></script>
<!-- CodeMirror syntax highlighting - this is optional -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.61.1/codemirror.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.61.1/codemirror.css">
<script src="cm/basic.js"></script>
<link rel="stylesheet" href="cm/basic.css">
<style>
.CodeMirror { border: solid 1px black; width: 598px; height: 384px; background-color: white; }
.CodeMirror-scroll { height: 100%; }
</style>
<h1>Applesoft BASIC in Javascript</h1>
<p>
By <a target=_blank href="mailto:inexorabletash@gmail.com">Joshua Bell</a>
| <a target="_blank" href="https://github.com/inexorabletash/jsbasic/">Source</a>
| <a target="_blank" href="https://github.com/inexorabletash/jsbasic/blob/master/README.md">README</a>
— <a target="_blank" href="reference.html">Applesoft BASIC Quick Reference</a>
<p>Related projects:
<a href="https://inexorabletash.github.io/jslogo/">Logo in Javascript</a>
| <a href="https://a2stuff.github.io/vnIIc">Streaming video to an Apple II - vnIIc</a>
</p>
<br style="clear: both;">
<!-- Screen -->
<div id="frame" class="jsb-frame" style="float: left; margin: 5px;" tabIndex="0">
<div id="screen-wrapper" class="jsb-wrapper">
<div id="lores" class="jsb-lores"></div>
<canvas id="hires" width="560" height="384" class="jsb-hires"></canvas>
<canvas id="hires2" width="560" height="384" class="jsb-hires"></canvas>
<div id="screen" class="jsb-tty"></div>
</div>
</div>
<!-- Source -->
<div style="float: left; margin: 5px;">
Enter code:
<button id="btn_run">▶ Run</button>
<button id="btn_stop" disabled>◼ Stop</button>
<select id="lb_files">
<option disabled selected="selected">Select a sample...</option>
<option value="sample.basic">DEMOS</option>
<option disabled>____________________________________________</option>
<option disabled>Tests</option>
<option value="sample.unittests"> Unit Tests</option>
<option value="sample.keyboard"> Keyboard Test</option>
<option value="sample.charset"> Charset Test</option>
<option disabled>____________________________________________</option>
<option disabled>Games</option>
<option value="simple.pong"> SIMPLE.PONG</option>
<option value="sample.adventure"> Text Adventure (Floyd McWilliams)</option>
<option value="sample.pacman"> (Not Really) ASCII Pac-Man (Michael Kemp)</option>
<option value="sample.puzzler"> Puzzler (Gregg Buntin)</option>
<option value="sample.hangman"> Hangman (Mike Gleason)</option>
<option value="sample.raindrops"> Catch the Raindrop (Nicholas Merchant)</option>
<option value="sample.jot"> JOT (Mike Gleason)</option>
<option value="sample.miniindy"> Mini Indy (Gregg Buntin)</option>
<option value="sample.doordetector"> Door Detector (Jeff)</option>
<option value="sample.columns"> Columns (Arthur Allen)</option>
<option value="sample.tetris"> Tetris (Arthur Allen)</option>
<option value="sample.dicegame"> Colorful Dice (Gregory Lewis)</option>
<option value="sample.aritm"> Aritm - Mental calculation (Mikael O. Bonnier)</option>
<option value="sample.unfinishedmaze"> Unfinished Maze (Alexander G. Tozzi)</option>
<option value="sample.dragonsmaze"> Dragon's Maze (Russell Hokanson)</option>
<option value="sample.blackhole"> Black Hole Maze (S.M.Compton c/o Melody Ayres-Griffiths)</option>
<option value="sample.chase"> Chase (Dominik Heidler)</option>
<option value="sample.spaceattack"> Space Attack! (Alan Ratliff)</option>
<option disabled>____________________________________________</option>
<option disabled>Graphics</option>
<option value="sample.rodscolorpattern"> Rod's Color Pattern</option>
<option value="sample.hacker"> Hacker Logo (markwstock)</option>
<option value="sample.loreswalk"> Random LoRes (John Melesky)</option>
<option value="sample.hireswalk"> Random HiRes (John Melesky)</option>
<option value="sample.sierpinski"> Sierpinski Triangles (Kevin Miller)</option>
<option value="sample.stringart"> String Art (Chris Heric)</option>
<option value="sample.paint"> Drawing Program (Brian Broker)</option>
<option value="sample.scribble"> Scribble (William Simms)</option>
<option value="sample.connections"> Connections (Gregg Buntin)</option>
<option value="sample.squiggle"> Squiggle (Gregg Buntin)</option>
<option value="sample.boys_surface"> Boy's Surface (Lukas Innig)</option>
<option value="sample.gaussian"> Gaussian Distribution 2D (John Russ)</option>
<option value="sample.bitmaps"> Bitmap Images (Brian Broker)</option>
<option value="sample.mandelbrot"> Mandelbrot Set (c/o Gregory Lewis)</option>
<option value="sample.mandelbrot2"> Mandelbrot Set in Color</option>
<option value="sample.steve"> Steve (Nicola Foggi)</option>
<option value="sample.logo"> Apple Logo (Brendan Robert)</option>
<option value="sample.loresdrawing"> Graphics Drawing (Gregg Buntin)</option>
<option value="sample.calculatedimage"> Calculated Image (Gregg Buntin)</option>
<option value="sample.xmastree"> Christmas Tree (Gregg Buntin and Rich Orde)</option>
<option value="sample.snowflakes"> Snowflakes (Kevin Riordan)</option>
<option value="sample.ninjaturtle"> Ninja Turtle (Chris Whong)</option>
<option value="sample.3dhat"> 3D Hat (Micro, the 6502 magazine, may 1981 c/o Golden Child)</option>
<option value="sample.dbconverge"> Double-Buffered Value Convergence (Golden Child)</option>
<option value="sample.dbpendulum"> Double-Buffered Physics Pendulum Simulation (Golden Child)</option>
<option value="sample.dbvectorship"> Double-Buffered Asteroids Ship Demo (Golden Child)</option>
<option value="sample.dbvectortext"> Double-Buffered Vector Font (Golden Child)</option>
<option value="sample.stellar7"> STELLAR 7 Rotate 3d Objects (Golden Child)</option>
<option value="sample.functiongraphing"> Function Graphing (Golden Child)</option>
<option value="sample.coloredserpinski"> Colored Serpinski Triangles (Gregory Lewis)</option>
<option value="sample.radar"> Radar (Josiah Keller)</option>
<option value="sample.moire"> Moiré (Sylvie Breaud)</option>
<option value="sample.jobs"> Steve Jobs (Nick McMillen / CJBaird)</option>
<option value="sample.dye"> Will You Dye (Brett Edwards)</option>
<option value="sample.pretzel"> Pretzel (Zee)</option>
<option value="sample.3drectangle"> 3D Rectangle (Tomo Wa)</option>
<option value="sample.enterprise"> Original Series Enterprise (Gil Keidar)</option>
<option value="sample.colorrings"> Colored Rings (Miika Oja)</option>
<option disabled>____________________________________________</option>
<option disabled>Other</option>
<option value="sample.primes"> Prime Sieve (Kevin Miller)</option>
<option value="sample.february"> February Surprise (Antti Pirskanen)</option>
<option value="sample.hellosine"> Hello World Sine Wave (Jamie Beu)</option>
<option value="sample.bodymass"> Body Mass Index Calculator (Tim Dwyer)</option>
<option value="sample.quine"> Quine (Nikolay Mirin)</option>
<option value="sample.10print"> 10 PRINT MAZE (translated by Rich Hanes)</option>
<option value="sample.primecheck"> Prime Check (Tony Hill)</option>
<option value="sample.vdt"> Velocity/Distance/Time (feman1977)</option>
<option value="sample.protonelectron"> Proton/Electron Mass Ratio (Mark Rohrbaugh)</option>
<option value="sample.onelinetrain"> One Liner Train (Chris ten Den)</option>
<option value="sample.piglatin"> Pig Latin Translator (Gregg Buntin)</option>
<option value="sample.nuclear"> Nuclear Power Plant (Stephen R. Berggren c/o Kevin Riggle)</option>
<option value="sample.factors"> Prime Factors (Cristiano Trabuio)</option>
<option disabled>____________________________________________</option>
<option disabled>Traveller RPG Utilities</option>
<option value="TRADER C"> TRADER</option>
<option value="sample.sectorgen"> Traveller Sector Generator</option>
<option value="sample.zhorelay"> Zhodani Relay Station Placement</option>
<option value="sample.readsector"> Read Sector File</option>
</select>
<!-- Source code editor inserted here -->
<div id="editorframe"></div>
<form id="submission" method="post" enctype="text/plain" action="mailto:inexorabletash@gmail.com?subject=Applesoft%20Sample%20Submission" target=_blank>
<textarea name="source" id="source" style="display: none;">
</textarea>
<button id="btn_save" title="Save as a file">💾 Save</button>
<button id="btn_load" title="Load a file">📂 Load</button>
<button id="btn_share" title="Share by email">📩 Share</button>
<button id="show_paper" title="Echo all output to a "print-out", so you can copy/paste">📃 Show output</button>
<button id="hide_paper" title="Hide the "print-out"">🚫 Hide output</button>
</form>
</div>
<br style="clear: both;">
<h3 id="links">Links</h3>
<ul>
<li>
Real emulators in JavaScript:
<a target="_blank" href="http://www.scullinsteel.com/apple2/">Apple IIjs</a>,
<a target="_blank" href="http://www.scullinsteel.com/apple//e">Apple //jse</a>,
<a target="_blank" href="http://www.megidish.net/apple2js/index.html">Apple2JS</a>,
and
<a target="_blank" href="https://github.com/nicholasbs/appletoo">many</a>
<a target="_blank" href="http://porkrind.org/a2/">more</a>
<li><a target="_blank" href="http://www.6502asm.com/">6502asm.com</a> - a 6502 assembler/emulator in JavaScript
<li><a target="_blank" href="http://www.quitebasic.com/">Quite BASIC</a> - a similar project aimed at teaching programming
</ul>
<div id="paper-spacer"></div>
<div id="paper"></div>
<script src="basic.js?2012-02-08"></script>
<script src="bell.js"></script>
<script src="tty.js"></script>
<script src="lores.js"></script>
<script src="hires.js"></script>
<script src="dos.js"></script>
<script src="printer.js"></script>
<script src="index.js"></script>