Tuesday, November 18, 2014

Bouncy maze







levels=5
fastgraphics
graphsize 600,600
clg
dim board$ (16,levels)
board$ [0,0]= "xxxxxxxxxxxxxxxxxxxxxxxxxx"
board$ [1,0]= "x                        x"
board$ [2,0]= "x                        x"
board$ [3,0]= "x    xxxxxxxxxxxxxxxx    x"
board$ [4,0]= "x                   x    x"
board$ [5,0]= "x                   x    x"
board$ [6,0]= "xxxxxxxxxxxxxxx     x    x"
board$ [7,0]= "x                   x    x"
board$ [8,0]= "x                   x    x"
board$ [9,0]= "x         xxxxxxxxxxx    x"
board$ [10,0]="x         x         x    x"
board$ [11,0]="x         x         x    x"
board$ [12,0]="x    x    x    x    x    x"
board$ [13,0]="x              x         x"
board$ [14,0]="x              x         x"
board$ [15,0]="xxxxxxxxxxxxxxxxxxxxxxxxxx"
font "courier" ,25,200
#initial speed and position
px=100
py=140
ax=2
ay=2
# main loop
do
for y =  0 to 15
text 0,y*25,board$[y,0]
next y

circle px,py,10
refresh
clg
if mid(board$[floor(py/25-.2),0],ceil(px/19+0.4),1)="x" then
ax=-ax
end if
if mid(board$[floor(py/25-.2),0],ceil(px/19+0.2),1)="x" then
ax=-ax
end if
if mid(board$[floor(py/25-.1),0],ceil(px/19+0.3),1)="x" then
ay=-ay
end if
if mid(board$[floor(py/25-.3),0],ceil(px/19+0.3),1)="x" then
ay=-ay
end if
px=px+ax
py=py+ay
until 3=2

Saturday, November 15, 2014

Report generator for busy teachers

for n = 0 to 10
pause 0.01
print "Benny ";
a=int(rand*3)
if a=0 then print "evolves ";
if a=1 then print "develops his work ";
if a=2 then print "has improved ";
a=int(rand*5)
if a=0 then print "brilliantely";
if a=1 then print "fantasticaly";
if a=2 then print "very well";
if a=3 then print "exeptionally";
if a=4 then print "with exellence";
print ". The homework is ";
a=int(rand*5)
if a=0 then print "marvellous.";
if a=1 then print "a true wonder.";
if a=2 then print "outstanding.";
if a=3 then print "unique.";
if a=4 then print "beautifull.";
a=int(rand*3)
if a=0 then print "We trust ";
if a=1 then print "We assume ";
if a=2 then print "We believe ";
a=int(rand*4)
if a=0 then print "he will achive ";
if a=1 then print "he is going to get ";
if a=2 then print "he will get ";
if a=3 then print "he is going to attain ";
a=int(rand*4)
if a=0 then print "fantastic results."
if a=1 then print "high grades."
if a=2 then print "lots of As."
if a=3 then print "tonnes of A*s."
next n