The complete list of variables, arrays and functions predefined.
Names Built in the imeight Language
The imeight language is decoupled from the video capabilities, although the imeight emulator provides you with both the language and the video. Here are the names that are essential for the programming language, rather than ones that operate the video.
Language Variables
- PI (π)
- TZO (Time Zone Offset)
Language Functions
- NOT (bitwise)
- SGN (sign)
- FRAC (fractional part)
- INT (integer part)
- ABS (absolute value)
- SQR (square root)
- RND (random integer < argument)
- LOG (logarithm, natural)
- EXP (exponential function – base e)
- COS (cosine, argument expected in radians)
- SIN (sine, argument expected in radians)
- TAN (tangent, argument expected in radians)
- ATN (arc tangent, return value in radians)
- PEEK (read a byte from a memory register, 0 <= argument < 65536)
- LEN (length of a string in characters)
- STR$ (string value of a variable, representing numbers in decimal)
- VAL (number value of a variable, or error if it is not representing a number in decimal)
- ASC (ASCII code of the first character in argument)
- CHR$ (the character represented by the number in argument in ASCII table)
- LEFT$ (substring from the beginning of the first argument, as long as specified in second argument)
- RIGHT$ (substring from the end of the first argument, as long as specified in second argument)
- MID$ (substring of the first argument, from 1-based character index specified in 2nd argument, as long as specified in 3rd argument)
- TIME$ (human readable time, accepts a timestamp in argument, or returns UTC clock)
- TIME (numeric timestamp from UTC clock)
- INI (tells if the variable or array element in the argument is initialized)
- Parentheses
- Unary Minus Sign
Video Capability Mappings
These names are predefined in and for the video engine. You may want to just use the video.js from the runner, driving it using custom JavaScript of your own, without the language. If you're a JavaScript hacker...
Video Variables
- BACKGROUND (color)
- CURSORX (PRINT/INPUT position X coordinate)
- CURSORY (PRINT/INPUT position Y coordinate)
- CURSORPERIOD (cursor blink time period in 20 millisec units)
- CURSORON (cursor blink on-state duration in 20 millisec units)
- READYPROMPT (ready prompt text... yeah, I forgot about the dollar sign, whatever)
- MUSIC$ (URL for background music to play)
- MUSICTIME (playing position of background music in seconds)
- MUSICEND (duration of background music in seconds)
- TILEX (tile layer's pixel offset X component)
- TILEY (tile layer's pixel offset Y component)
- TILEPRIO (tile layer's priority)
- FONTALNUM (alphanumeric font pointer)
- FONTSIGNS (other font pointer)
- TEXTX (text layer's offset X in pixels)
- TEXTY (text layer's offset Y in pixels)
- TEXTCOLORUC (color of uppercase letters and other characters C$ where ASC(C$) AND $20 = 0)
- TEXTCOLORLC (color of lowercase letters and other characters C$ where ASC(C$) AND $20 = $20)
- TEXTPRIO (text layer's priority)
Video Arrays
You are free to choose an index for each sprite. Just refer to the same sprite with the same index. Index can be number or string, or even comma-separated list of such.
- SPRX (sprite's X coordinate)
- SPRY (sprite's Y coordinate from top)
- SPRDGN (sprite's design pointer)
- SPRPRIO (sprite's priority)
- TILE (indexed row, column; design pointer values)
- TEXTLINE$ (indexed with line number 0 to 27, string values)
Video Functions
Touch events are specified by the code that is assigned to the variable by a GET instruction.
- TOUCHX (tells position X coordinate given a touch event)
- TOUCHY (tells position Y coordinate given a touch event)
Built-in Sprite/Tile Designs
Replace design pointer values with return values of these functions to use built-in designs instead of memory.
- DGNBALL24
- DGNBALL10
- DGNBALL4
- DGNBOMB
- DGNCAR
- DGNDEATH
- DGNDOOR
- DGNDRAGON
- DGNDUST
- DGNGEM
- DGNHAMMER
- DGNHEART
- DGNKEY
- DGNLADDER
- DGNMAN
- DGNMEDIKIT
- DGNPADHORZ
- DGNPADVERT
- DGNPLANE
- DGNROBOT
- DGNROCKET
- DGNSWITCHLT
- DGNSWITCHRT
- DGNUFO
- DGNWALL
See images on page [Factory Designs]
If you wanna set READYPROMPT, do it like this,
If you omit the LET, it would become a malformatted READ instruction.