free media alliance
free software, free culture, free hardware
[lit][generate-title]
[lit]
based on figplus and some ideas from [lit]drummyfish[lit]
[url]https://freemedia.neocities.org/library/wip02.py[url] fixes lowercase parsing
[url]https://freemedia.neocities.org/library/wip01.py[url] original; based on figplus 0.5
a make array x swap 2 vars variables
––––––––––––––––––––––––––––––––––––––––––––––––––––––––
[ input u sleep input
d date k time
––––––––––––––––––––––––––––––––––––––––––––––––––––––––
] output z clear c colour output
f pset v locate b background
––––––––––––––––––––––––––––––––––––––––––––––––––––––––
% mod ^ power * multiply math
( sine ) cosine - subtract
_ arctan + add | tangent
/ divide n val i int
––––––––––––––––––––––––––––––––––––––––––––––––––––––––
@ for loop & while loops
––––––––––––––––––––––––––––––––––––––––––––––––––––––––
= if equal { else } complete conditionals
< if less > if more ? if true
t try e except
––––––––––––––––––––––––––––––––––––––––––––––––––––––––
# comment : function , split functions
~ return q quit w get ascii
s shell r right g parameters
y arrset h stdin j join
m mid o len l left p python
[img]wip.png[img]
param g ; now 'command line parameters:' ] ; now c 7 b 1 g ] b 0
date d ; now 'date: ' + date ]
time k ; now 'time: ' + time ]
yourname 'what is your name?' ] [ u .5 c 7 v 2 5 ; now 'hello, ' + yourname ]
: getascii fromwhat
now fromwhat l 1 w ~ now
}
? 1
now '1 is true' ]
}
> 10 5 # if more
now 'elephant' l 3 ] ; now 'elephant' r 5 ] ; now 'ant' m 2 1 ]
= 1 1
now 'yes, 1 is equal to 1' ]
}
{
now 'no, 10 is not more than 5' ]
}
t # try except
now 1 / 0
e
now 'you cant divide by zero' ]
}
now '5 minus 3 is:' ] ; now 5 - 3 ]
now 'the integer of pi is:' ] ; pi 1 _ * 4 i ] # int((atan 1) * 4)
now getascii 'hello' ] ;p;print('this is python ')*5;}
now 'wip can make arrays:' ]
items 'eggs sugar flour' , items ' ' ]
items y 3 'water' # change 3rd item
array 'oranges' a + items
itemslen array o
@ each 1 itemslen 1 ; now array m each 1 ] ; } # for loop
now j array ' ' ]
now 'ls | tail -1' s m 1 1 ]
pi 1 _ * 4 ; npi 0 - pi ; radius 10
@ pe npi pi .0001
xc pe ) * radius * 2 + radius + radius + 2 i
yc pe ( * radius + radius + 2 i
col xc * yc % 15 + 1 c col v yc xc ; now ']' ]
}
now v 1 1 c 7 q
now 'rock paper scissors' ] '' ]
now 'you know how it works--' ] '' ]
& ; rnd k m 7 2 n + 2 % 3 + 1
rps 'rock paper scissors' , rps ' ' m rnd 1
now 'ive already made my choice, ' ]
now 'say rock, paper or scissors and that' ]
play 'decides who wins. go ahead then:' ] '' ] [ ; now '' ]
tie 0
= play 'rock'
= rps 'rock'
now 'tie! we both had rock' ]
tie 1
}
= rps 'paper'
now 'sorry, my paper beats your rock' ]
}
= rps 'scissors'
now 'your rock beats my scissors, you win!' ]
}
}
= play 'paper'
= rps 'rock'
now 'your paper beats my rock, you win!' ]
}
= rps 'paper'
now 'tie! we both had paper' ]
tie 1
}
= rps 'scissors'
now 'sorry, my scissors cut your paper' ]
}
}
= play 'scissors'
= rps 'rock'
now 'sorry, my rock beats your scissors' ]
}
= rps 'paper'
now 'your scissors cut my paper, you win!' ]
}
= rps 'scissors'
now 'tie! we both had scissors' ]
tie 1
}
}
no '' ]
? tie ; no 'y'
{ ; now 'play again?' ] [ ; no now m 1 1
} # play again if tie
= no 'n' ; now q ; } ; = no 'N' ; now q
}
}
back to [[../software-section]]
home: [lit]https://freemedia.neocities.org[lit]