# View log file written on Jan 27, 1988 4:59 am by DAVE
typeahead 7\n1 2 3\n4 5\n\n$y $x\nbar\nDave\n\n$foo G.\n
print 'foo'
# foo
print 'bar'
# bar
if 1>2
print 2
# 2
endif
print 'foo'
# foo
print 'foo'
# foo
print '## hello'
# ## hello
foo = 'bar'
bar = 42
print foo
# bar
print bar
# 42
echo foo
# foo
echo bar
# bar
i = 5
a5 = 43
print a5
# 43
j = 8
a5_8 = 19
print a5_8
# 19
i = 5
echo 5
# 5
echo 8
# 8
echo hithere
# hithere
a3_4 = 7
b7 = 4
i = 3
j = 4
k = 7
echo    a3_4
# a3_4
print   a3_4
# 7
echo  b7
# b7
print b7
# 4
echo          b7
# b7
print         b7
# 4
echo  a3_4
# a3_4
print a3_4
# 7
echo 'foo$i'
# 'foo$i'
echo "foo3"
# "foo3"
echo $foo
# $foo
name = '  Foo  '
food = 'spam'
blank = ''
i = -16.3e+12
j = 6
echo *  Foo  *
# *  Foo  *
echo *  Foo  *
# *  Foo  *
echo *Foo*
# *Foo*
echo *  FOO  *
# *  FOO  *
echo *  foo  *
# *  foo  *
echo *'  Foo  '*
# *'  Foo  '*
echo *name*
# *name*
echo foo-1.63e13
# foo-1.63e13
echo foo_1.63e13
# foo_1.63e13
echo **
# **
echo *yow*
# *yow*
echo *  Foo  *
# *  Foo  *
echo *-1.63e13*
# *-1.63e13*
echo **
# **
echo *-1.63e13*
# *-1.63e13*
echo *i*
# *i*
echo *yow*
# *yow*
echo *3.141592654*
# *3.141592654*
echo *3.142*
# *3.142*
echo *    6*
# *    6*
echo *spam *
# *spam *
echo    '6'
# '6'
echo *6    *
# *6    *
echo *3.14159*
# *3.14159*
echo *  3.14*
# *  3.14*
echo *  3.14*
# *  3.14*
echo *spam*
# *spam*
echo *pam*
# *pam*
echo *spa*
# *spa*
echo *pa*
# *pa*
echo *p*
# *p*
echo z='spam'
# z='spam'
echo z='SPAM'
# z='SPAM'
echo z='SPAM  '
# z='SPAM  '
echo z='AM  '
# z='AM  '
echo z='AM '
# z='AM '
print 1+2
# 3
print 'hi'+'there'
# hithere
print 1-2
# -1
print 3*2
# 6
print 3/2
# 1.5
print 3^2
# 9
print 1234\100
# 12
print 1234%100
# 34
print 10&6
# 2
print 10|6
# 14
print (10@6)
# 12
print ~6
# -7
print 6<<2
# 24
print 6>>2
# 1
print (6=7)
# 0
print (7=7)
# 1
print (6<>7)
# 1
print (6<7)
# 1
print (6<=7)
# 1
print (6>7)
# 0
print (6>=7)
# 0
print ('a'<'b')
# 1
print (''<='any str')
# 1
print ('foo'<'fool')
# 1
print 1+(6<7)
# 2
print (1=1||2=3)
# 1
print (1=1&&2=3)
# 0
print !(1=1)
# 0
print 67||23
# 67
print 0||23
# 23
print 67&&23
# 23
print 0&&23
# 0
print 'foo'||'bar'
# foo
print ''||'bar'
# bar
print (1?67:23)
# 67
print (0?67:23)
# 23
print (2=3?67:23)
# 23
print (i<1?1:i>10?10:i)
# 1
print (1?'foo':'bar')
# foo
print (0?'foo':'bar')
# bar
print (''?67:23)
# 23
print ('yow'?'a':'b')
# a
basis b1 = 0:10:2
print cvlen('b1')
# 6
mycurve = 'b1'
print cvlen(mycurve)
# 6
print cvidx('b1',1)
# 0
print cvidx('b1_x',2)
# 2
print cvidx('b1', cvlen('b1'))
# 10
c1 = b1 + cvrelidx('b1',1)
c1 = cvrelidx('b1',1)
c1 = cvrelidx('b1',1) : b1
c1 = 0 : b1
if 2 = 2
print 'hello'
# hello
endif
if 2 = 3
if i = 0
print 'false'
# false
endif
if i = 0
print 'negative'
# negative
else
if i = 0
if i < 0
print 'negative'
# negative
else
endif
switch i+1
print 'I dunno'
# I dunno
endswitch
name = 'joe'
switch name
print 'Name starts with "j"'
# Name starts with "j"
endswitch
switch [ci] name
print 'Hi, Joe.'
# Hi, Joe.
endswitch
for i = 1:5
print i
# 1
endfor
print i
# 2
endfor
print i
# 3
endfor
print i
# 4
endfor
print i
# 5
endfor
for i = 5:1
for i = 1:5:2
print i
# 1
endfor
print i
# 3
endfor
print i
# 5
endfor
for i = 5:1:-1
print i
# 5
endfor
print i
# 4
endfor
print i
# 3
endfor
print i
# 2
endfor
print i
# 1
endfor
for i = 0:1:0.1
print i
# 0
endfor
print i
# 0.1
endfor
print i
# 0.2
endfor
print i
# 0.3
endfor
print i
# 0.4
endfor
print i
# 0.5
endfor
print i
# 0.6
endfor
print i
# 0.7
endfor
print i
# 0.8
endfor
print i
# 0.9
endfor
print i
# 1
endfor
i = 1
while i <= 5
print i
# 1
i = i + 1
endwhile
print i
# 2
i = i + 1
endwhile
print i
# 3
i = i + 1
endwhile
print i
# 4
i = i + 1
endwhile
print i
# 5
i = i + 1
endwhile
i = 1
repeat
print i
# 1
i = i + 1
until i > 5
print i
# 2
i = i + 1
until i > 5
print i
# 3
i = i + 1
until i > 5
print i
# 4
i = i + 1
until i > 5
print i
# 5
i = i + 1
until i > 5
i = 1
while
print i
# 1
if i = 5
i = i + 1
endwhile
print i
# 2
if i = 5
i = i + 1
endwhile
print i
# 3
if i = 5
i = i + 1
endwhile
print i
# 4
if i = 5
i = i + 1
endwhile
print i
# 5
if i = 5
break
i = 1
while i > 5
repeat
readnum size : Enter size of boulders:
until size > 0 && size < 1e6
j = 5
for i = 1 : j
print i
# 1
j = 2
endfor
print i
# 2
j = 2
endfor
print i
# 3
j = 2
endfor
print i
# 4
j = 2
endfor
print i
# 5
j = 2
endfor
for i = 1 : 5
print i
# 1
if i = 2
endfor
print i
# 2
if i = 2
i = 4
endif
endfor
print i
# 3
if i = 2
endfor
print i
# 4
if i = 2
endfor
print i
# 5
if i = 2
endfor
for i = 1:10
for j = 1:10
break
endfor
for j = 1:10
break
endfor
for j = 1:10
break
endfor
for j = 1:10
break
endfor
for j = 1:10
break
endfor
for j = 1:10
break
endfor
for j = 1:10
break
endfor
for j = 1:10
break
endfor
for j = 1:10
break
endfor
for j = 1:10
break
endfor
for i = 1:10
for j = 1:10
break 2
echo This is   a message.
# This is   a message.
foo = 'This is   a message.'
echo This is   a message.
# This is   a message.
print 'This is   a message.'
# This is   a message.
print 3+2 3-2
# 5 1
print (3 + 2)
# 5
print pi
# 3.1415926536
print '*' pi:5 '*'
# *3.142*
print '*' 16:5 '*'
# *   16*
print '*' pi::5 '*'
# *3.14159*
print '*' pi:6:2 '*'
# *  3.14*
name = 'Joe'
print '*' name:5 '*'
# *Joe  *
print '*' '3':5 '*'
# *3    *
readnum x y z
readnum x y : Position?
readnum [opt] x y
readnum [exp] x y
readln foo
readln foo : What is your name?
readln [opt] foo
readln [exp] foo
define listz
define incr var
define hello n
define ebasis curve = min : max
define [after] ebasis curve = max
define [before] basis "[exp]" curve = min : max
basis linb = 1:10
basis [exp] logb = 1:10
ebasis logb = 1 : 10
local temp
basis temp = log(1) : log(10)
temp = 10^temp
splice logb = temp : temp
define reverse newcurve = curve
define [after] reverse curve
define swapxy newcurve = curve
define [after] swapxy curve
define tweak {curves} : {vars}
define [after] tweak {vars}
define [before] tweak
define boxfilter newcurve = curve
define [after] boxfilter curve
define filter newcurve = curve : width
define [after] filter newcurve = curve
define [after] filter curve : width
define [after] filter curve
avg(x,y) = (x+y)/2
print avg(3,5)
# 4
factorial(x) = gamma(x+1)
step(x) = x>=0 ? 1 : 0
step2(x) = x>0 ? 1 : x<0 ? 0 : 0.5
gain = 10
smstep(x) = (tanh(10*x)+1)/2
smstep(x) = (tanh(gain*x)+1)/2
letters = 'abcdefghijklmnopqrstuvwxyz'
rletter() = strsub(letters, irand(1,26))
print rletter()
# p
print rletter
# t
