The Javascript version of First Screening (English)

View the JavaScript version of First Screening.

Download the source code (40.4 Kb). The JavaScript version was written by Marko J. Niemi and Jim Andrews.

First Screeningin suomenkielinen JavaScript-versio Ensiesitys

Katso Ensiesitys.

Lataa lähdekoodi (42 kt). Suomennos englannista Terhi Hannula ja Marko Niemi. Ohjelmointi Marko Niemi ja Jim Andrews.

Suomenkielinen versio löytyy myös Nokturnosta

About the JavaScript version by Marko Niemi

From: Jim Andrews
Sent: November 22, 2006 11:44 PM
To: Marko J. Niemi; Dan Waber; Geof Huth; Lionel Kearns Subject: Marko's JavaScript version

Hi Marko,

How did you do your JavaScript version of First Screening? In particular, I'm wondering if you had to look at the code itself, or if you just eyeballed the emulated version carefully, or made a movie of it so as to examine it in stop-frame, or what. Because it's so bang on. How'd you do it?

Also, I gather there were a couple of iterations in your code? How did that go?

From: Marko Niemi
Sent: November 23, 2006 1:41 PM
To: Jim Andrews; Dan Waber; Geof Huth; Lionel Kearns Subject: Re: Marko's JavaScript version

Hi Jim and others,

Some parts of the JavaScript code are meant to be as directly equivalent to the original BASIC code as possible; for instance, the 'Print(vtab, htab, text)' JavaScript function works pretty much the same as 'VTAB Y: HTAB X: PRINT "<TEXT>"' lines in BASIC (VTAB and HTAB define the coordinates of the text in question; in JavaScript, the top-left position of the screen is at (0,0) whereas in BASIC it's at (1,1)).

SPEED variables have their equivalents in 'pause()' arrays (SPEED=255 is the fastest tempo in BASIC and SPEED=0 probably the slowest, whereas in JavaScript the smaller the 'pause', the faster the tempo), and the 'Home()' function clears the screen the same way as the HOME command in BASIC.

But then there were parts in the BASIC code, that don't have their equivalents in the more graphically oriented JavaScript environment, the most notable example being the flushing/flickering effect at the bottom line in the 'SELF-REFLEXIVE 2' piece for inctance. That was translated simply by swapping the 'THE BOTTOM LINE IS WHERE CHANGE IS' line and an empty line in rapid succession. In the 'CONSTRUCTION ONE' piece, the flickering effect at the bottom line seemed to vary a bit from reading to reading, so, in the JavaScript version, a somewhat similar effect is made by choosing at random the moments when the TOWER word flashes at the bottom line.

After I had first written these 'emulated' JavaScript functions, it was pretty much about tweaking and tweaking tempos of each piece and each line/word/letter in each piece, and watching the emulator version and the JavaScript version side by side, to adjust the JavaScript version to as close to the emulator version as possible.


Click to visit