git @ Cat's Eye Technologies yoob.js / 60a3121
Updates for release of yoob.js 0.4. catseye 12 years ago
6 changed file(s) with 56 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
00 yoob.js
11 =======
22
3 *Version 0.4-PRE. Everything subject to change.*
3 *Version 0.4. Everything subject to change.*
44
55 yoob.js is the HTML5 counterpart to [yoob][].
66
2929 * does not support unbounded integer values (yet; see "Planned", below).
3030 * provides components which are meant to be used as starting points for
3131 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
3333 a specific grammar of your choice.
3434
3535 yoob.js will eventually:
7474
7575 A two-dimensional Cartesian grid of values which dynamically expands as
7676 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.
7879
7980 * `yoob.Cursor`, in `yoob/cursor.js`
8081
9293
9394 A view (in the MVC sense) which associates a `yoob.Playfield` with any
9495 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.*
10399
104100 * `yoob.TextTerminal`, in `yoob/text-terminal.js`
105101
106102 A crude simulation of a text-based addressable console, including some
107103 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
110109 * `yoob.LineInputBuffer`, in `yoob/line-input-buffer.js`
111110
112111 A crude simulation of a buffer into which the user can type a line of
205204 * [Gemooy][]
206205 * [noit o' mnain worb][]
207206 * [Super Wumpus Land][]
207 * [REDGREEN][]
208 * [Circute][]
209 * [Braktif][]
210 * [Jaccia][] and Jacciata
208211
209212 ...and soon to be used in ALPACA and the various cellular automata defined
210213 therein.
214217 [Javascript BigInteger]: https://github.com/silentmatt/javascript-biginteger
215218 [noit o' mnain worb]: http://catseye.tc/node/noit%20o%27%20mnain%20worb.html
216219 [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
217224
218225 Changelog
219226 ---------
247254
248255 Added `get(Max|Min)(X|Y)` methods to `yoob.Playfield`, and fixed
249256 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
00 /*
1 * This file is part of yoob.js version 0.4-PRE
1 * This file is part of yoob.js version 0.4
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */
00 /*
1 * This file is part of yoob.js version 0.4-PRE
1 * This file is part of yoob.js version 0.4
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */
00 /*
1 * This file is part of yoob.js version 0.4-PRE
1 * This file is part of yoob.js version 0.4
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */
77 /*
88 * A view (in the MVC sense) for depicting a yoob.Playfield (-compatible)
99 * object onto any HTML element that supports innerHTML.
10 *
11 * TODO: *** THIS DOES NOT WORK *** please do not use it yet
1012 */
1113 yoob.PlayfieldHTMLView = function() {
1214 this.pf = undefined;
00 /*
1 * This file is part of yoob.js version 0.4-PRE
1 * This file is part of yoob.js version 0.4
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */
00 /*
1 * This file is part of yoob.js version 0.4-PRE
1 * This file is part of yoob.js version 0.4
22 * Available from https://github.com/catseye/yoob.js/
33 * This file is in the public domain. See http://unlicense.org/ for details.
44 */