<!DOCTYPE html>
<!DOCTYPE html>
---- foo.bas ----
PRINT "Hello World!"
FOR i = 1 to 10
PRINT "Counting "; i
NEXT i
var basic = require('./wwwbasic.js');
basic.Basic(
`
PRINT "Hello World!"
FOR i = 1 to 10
PRINT "Counting "; i
NEXT i
`);
SCREEN 21
FOR i = 1 to 40
FOR j = 1 to 30
CIRCLE (i * 30, j * 30), _
10, i * 6 * 65536 + j * 6 * 256,,,,F
NEXT j
NEXT i
SCREEN 21
FOR i = 1 to 1000
x1 = INT(RND() * 1280)
y1 = INT(RND() * 1024)
x2 = INT(RND() * 1280)
y2 = INT(RND() * 1024)
c = INT(RND() * 256 * 256 * 256)
LINE (x1, y1)-(x2, y2), c
NEXT i
SCREEN 21
GETMOUSE x, y, nw, nb
' Wait for mouse events.
DO
GETMOUSE nx, ny, nw, nb
LOOP WHILE x = nx and y = ny
x = nx : y = ny
' Draw a green line following the mouse.
Again:
GETMOUSE nx, ny, nw, nb
LINE (x, y)-(nx, ny), 256 * 255
x = nx : y = ny
GOTO Again
basic_test.BASIC_TEST('PrintUsing', 'SimpleDecimal', `
PRINT USING "abc #.#### def"; 1.23
`, `
abc 1.2300 def
`);
wwwbasic source
and
slides
at:
github.com/flagxor