0 | 0 |
yoob.js
|
1 | 1 |
=======
|
2 | 2 |
|
3 | |
*Version 0.4-PRE. Everything subject to change.*
|
|
3 |
*Version 0.4. Everything subject to change.*
|
4 | 4 |
|
5 | 5 |
yoob.js is the HTML5 counterpart to [yoob][].
|
6 | 6 |
|
|
29 | 29 |
* does not support unbounded integer values (yet; see "Planned", below).
|
30 | 30 |
* provides components which are meant to be used as starting points for
|
31 | 31 |
further modification. (It's all public domain, so build on it!) For
|
32 | |
example, `yoob.sexpParser` is meant to be used as an example or basis for
|
|
32 |
example, `yoob.SexpParser` is meant to be used as an example or basis for
|
33 | 33 |
a specific grammar of your choice.
|
34 | 34 |
|
35 | 35 |
yoob.js will eventually:
|
|
74 | 74 |
|
75 | 75 |
A two-dimensional Cartesian grid of values which dynamically expands as
|
76 | 76 |
needed. Objects of this class are suitable for representing programs in
|
77 | |
two-dimensional esolangs such as Befunge, as well as cellular automata.
|
|
77 |
two-dimensional esolangs such as Befunge, as well as cellular automata,
|
|
78 |
and suitable for use as a backing store for a text-terminal simulator.
|
78 | 79 |
|
79 | 80 |
* `yoob.Cursor`, in `yoob/cursor.js`
|
80 | 81 |
|
|
92 | 93 |
|
93 | 94 |
A view (in the MVC sense) which associates a `yoob.Playfield` with any
|
94 | 95 |
element which supports `innerHTML`, although typically a `<pre>` element.
|
95 | |
This will eventually take over most of what `yoob.TextTerminal` does now.
|
96 | |
|
97 | |
(A crude simulation of a text-based addressable console in something
|
98 | |
other than a `<canvas>`, but continuing to provide a sort of retro
|
99 | |
feel. Possibly implemented with a `<pre>` element or a `<div>` with
|
100 | |
a fixed-size font and significant whitespace set using CSS3.
|
101 | |
This will allow text to be rendered more nicely, and selected for
|
102 | |
copying/pasting in the browser, and so forth.)
|
|
96 |
Compared to the canvas view, this view will allow text to be rendered
|
|
97 |
more nicely in some browsers, be selected for copying/pasting in the
|
|
98 |
browser, and so forth. *As of 0.4, this is not yet complete.*
|
103 | 99 |
|
104 | 100 |
* `yoob.TextTerminal`, in `yoob/text-terminal.js`
|
105 | 101 |
|
106 | 102 |
A crude simulation of a text-based addressable console, including some
|
107 | 103 |
functions (which need not be used) which understand simple terminal
|
108 | |
control sequences, such as LF and backspace.
|
109 | |
|
|
104 |
control sequences, such as LF and backspace. Requires `yoob.Playfield`
|
|
105 |
and `yoob.Cursor` and, if you actually want to render the terminal in
|
|
106 |
a browser DOM, `yoob.PlayfieldCanvasView` or a compatible playfield
|
|
107 |
view class.
|
|
108 |
|
110 | 109 |
* `yoob.LineInputBuffer`, in `yoob/line-input-buffer.js`
|
111 | 110 |
|
112 | 111 |
A crude simulation of a buffer into which the user can type a line of
|
|
205 | 204 |
* [Gemooy][]
|
206 | 205 |
* [noit o' mnain worb][]
|
207 | 206 |
* [Super Wumpus Land][]
|
|
207 |
* [REDGREEN][]
|
|
208 |
* [Circute][]
|
|
209 |
* [Braktif][]
|
|
210 |
* [Jaccia][] and Jacciata
|
208 | 211 |
|
209 | 212 |
...and soon to be used in ALPACA and the various cellular automata defined
|
210 | 213 |
therein.
|
|
214 | 217 |
[Javascript BigInteger]: https://github.com/silentmatt/javascript-biginteger
|
215 | 218 |
[noit o' mnain worb]: http://catseye.tc/node/noit%20o%27%20mnain%20worb.html
|
216 | 219 |
[Super Wumpus Land]: http://catseye.tc/node/Super%20Wumpus%20Land.html
|
|
220 |
[REDGREEN]: http://catseye.tc/node/REDGREEN.html
|
|
221 |
[Circute]: http://catseye.tc/node/Circute.html
|
|
222 |
[Braktif]: http://catseye.tc/node/Braktif.html
|
|
223 |
[Jaccia]: http://catseye.tc/node/Jaccia.html
|
217 | 224 |
|
218 | 225 |
Changelog
|
219 | 226 |
---------
|
|
247 | 254 |
|
248 | 255 |
Added `get(Max|Min)(X|Y)` methods to `yoob.Playfield`, and fixed
|
249 | 256 |
issue with drawing cursors at wrong offsets.
|
|
257 |
|
|
258 |
* version 0.4
|
|
259 |
|
|
260 |
Moved all-display related code from `yoob.Playfield` into a new class,
|
|
261 |
`yoob.PlayfieldConsoleView`; in MVC parlance, `yoob.Playfield` is now
|
|
262 |
a "model", and to actually display it in a browser, you will need a
|
|
263 |
"view".
|
|
264 |
|
|
265 |
`yoob.PlayfieldConsoleView` has a `drawCell` method instead of the
|
|
266 |
old `drawElement` which will try to call `draw` on the value in the
|
|
267 |
cell, if it has such a method, and will also takes (and will pass) the
|
|
268 |
x and y co-ordinates of the cell in the playfield being drawn.
|
|
269 |
|
|
270 |
Removed `yoob.TextConsole`; use `yoob.TextTerminal` and don't call
|
|
271 |
`write()`, just call `writeRaw()`, if you want a console that doesn't
|
|
272 |
understand terminal control codes.
|
|
273 |
|
|
274 |
Refactored `yoob.TextTerminal` to be a facade over a `yoob.Playfield`
|
|
275 |
and a `yoob.Cursor`. Thus, you can now read characters from any
|
|
276 |
position in the terminal — however it has lost the ability to overstrike
|
|
277 |
characters. Again, since `yoob.Playfield` is now a "model",
|
|
278 |
`yoob.TextTerminal` itself does not concern itself with displaying the
|
|
279 |
terminal (although there is a helper method to create a canvas view.)
|
|
280 |
|
|
281 |
`yoob.LineInputBuffer` generally improved; it listens to `keydown`
|
|
282 |
instead of `keyup` for special keys, prevents the default action for
|
|
283 |
them, and has been tested in Firefox, Chrome, and Internet Explorer
|
|
284 |
(recent versions.)
|
|
285 |
|