Set display mode 800,600,32
randomize timer()
 
DIM vartype(12,4)
DIM buttons(96,2)
 
If path exist("calcyeffects")=0 then make directory "calcyeffects"
`input "select sequence type - 1 for manual and 0 for automatic",seqtype
`If seqtype=0 then input "display (0) or display&save (1):",qsave
`If qsave=1 then input "number of images to be saved before exiting",imgnum
INK RGB(160,160,160),0
BOX 0,0,39,19
INK RGB(192,192,192),0
line 0,0,39,0
line 0,0,0,19
INK RGB(96,96,96),0
line 0,19,39,19
line 39,0,39,19
INK RGB(192,192,192),0
line 1,1,38,1
line 1,1,1,18
INK RGB(96,96,96),0
line 1,18,38,18
line 38,1,38,18
GET image 89,0,0,39,19
 
CLS
 
INK RGB(160,160,160),0
BOX 0,0,119,19
INK RGB(192,192,192),0
line 0,0,119,0
line 0,0,0,19
INK RGB(96,96,96),0
line 0,19,119,19
line 119,0,119,19
INK RGB(192,192,192),0
line 1,1,118,1
line 1,1,1,18
INK RGB(96,96,96),0
line 1,18,118,18
line 118,1,118,18
GET image 90,0,0,119,19
 
ax=rnd(400)
ay=rnd(400)
bx=rnd(400)
by=rnd(400)
c=1000000
d=1000000
ex=rnd(400)
ey=rnd(400)
g=1000000
j=1
k=2
 
For x = 1 to 12
vartype(x,1)=rnd(11)+1
vartype(x,2)=rnd(22)+1
Next x
 
ouch:
 
CLS
 
lock pixels
For x = 1 to 400
For y = 1 to 400
 
aj#=(((x-ax)*(x-ax))+((y-ay)*(y-ay)))
bj#=(((x-bx)*(x-bx))+((y-by)*(y-by)))
ej#=(((x-ex)*(x-ex))+((y-ey)*(y-ey)))
ad#=((aj#))
bd#=((bj#))
ed#=((ej#))
intensityr#=k*(c/(ad#+1))+j*(d/(bd#+1))+(g/(ed#+1))
intensityg#=j*(c/(ad#+1))+(d/(bd#+1))+k*(g/(ed#+1))
intensityb#=(c/(ad#+1))+k*(d/(bd#+1))+j*(g/(ed#+1))
 
For u = 1 to 12
If vartype(u,1)=0 then vartype(u,3)=0
If vartype(u,1)=1 then vartype(u,3)=intensityr#
If vartype(u,1)=2 then vartype(u,3)=intensityg#
If vartype(u,1)=3 then vartype(u,3)=intensityb#
If vartype(u,1)=4 then vartype(u,3)=x
If vartype(u,1)=5 then vartype(u,3)=y
If vartype(u,1)=6 then vartype(u,3)=sqrt(((x-200)^2)+((y-200)^2))
If vartype(u,1)=7 then vartype(u,3)=intensityr#+intensityb#
If vartype(u,1)=8 then vartype(u,3)=intensityg#+intensityb#
If vartype(u,1)=9 then vartype(u,3)=intensityr#+intensityg#
If vartype(u,1)=10 then vartype(u,3)=intensityr#-intensityg#
If vartype(u,1)=11 then vartype(u,3)=intensityg#-intensityb#
If vartype(u,1)=12 then vartype(u,3)=intensityb#-intensityr#
 
If vartype(u,3)=0 then vartype(u,3)=1
 
If vartype(u,2)=0 then vartype(u,4)=0
If vartype(u,2)=1 then vartype(u,4)=100*tan(vartype(u,3))
If vartype(u,2)=2 then vartype(u,4)=100*cos(vartype(u,3))
If vartype(u,2)=3 then vartype(u,4)=100*sin(vartype(u,3))
If vartype(u,2)=4 then vartype(u,4)=10000/(vartype(u,3))
If vartype(u,2)=5 then vartype(u,4)=1000/sqrt(vartype(u,3))
If vartype(u,2)=6 then vartype(u,4)=rnd(vartype(u,3))
If vartype(u,2)=7 then vartype(u,4)=(vartype(u,3))
If vartype(u,2)=8 then vartype(u,4)=10*hcos(vartype(u,3))
If vartype(u,2)=9 then vartype(u,4)=10*hsin(vartype(u,3))
If vartype(u,2)=10 then vartype(u,4)=10*htan(vartype(u,3))
If vartype(u,2)=11 then vartype(u,4)=atan(vartype(u,3))
If vartype(u,2)=12 then vartype(u,4)=(vartype(u,3)*vartype(u,3))/100
If vartype(u,2)=13 then vartype(u,4)=100*cos(vartype(u,3))+100*sin(vartype(u,3))
If vartype(u,2)=14 then vartype(u,4)=100*cos(vartype(u,3))-100*sin(vartype(u,3))
If vartype(u,2)=15 then vartype(u,4)=100*sin(vartype(u,3))-100*cos(vartype(u,3))
If vartype(u,2)=16 then vartype(u,4)=150*cos(vartype(u,3))+50*sin(vartype(u,3))
If vartype(u,2)=17 then vartype(u,4)=150*cos(vartype(u,3))-50*sin(vartype(u,3))
If vartype(u,2)=18 then vartype(u,4)=150*sin(vartype(u,3))-50*cos(vartype(u,3))
If vartype(u,2)=19 then vartype(u,4)=rnd(200*sin(vartype(u,3)))
If vartype(u,2)=20 then vartype(u,4)=rnd(200*cos(vartype(u,3)))
If vartype(u,2)=21 then vartype(u,4)=rnd(200*tan(vartype(u,3)))
If vartype(u,2)=22 then vartype(u,4)=rnd(1000/sqrt(vartype(u,3)))
If vartype(u,2)=23 then vartype(u,4)=255-(vartype(u,3))
Next u
 
ValueA=vartype(1,4)
Valueb=vartype(2,4)
Valuec=vartype(3,4)
Valued=vartype(4,4)
Valuee=vartype(5,4)
Valuef=vartype(6,4)
Valueg=vartype(7,4)
Valueh=vartype(8,4)
Valuei=vartype(9,4)
Valuej=vartype(10,4)
Valuek=vartype(11,4)
Valuel=vartype(12,4)
 
`Rem change functions for different effects (keep sqrt and ABS)
`VARIABLES: intenistyr#, intensityb#, intensityg#, x and y are ALL interchangeable
`FUNCTIONS: 100*tan, 100*cos, 100*sin, 10000/, 1000/sqrt, rnd, 1*, 10*hcos, 10*htan, 10*hsin, atan are ALL interchangeable
`additional function: curveangle (3 parameters)
`|---Keep this------| |----------------change these functions-------------------------------------------------------------------|
intensityrx#=sqrt(ABS((valueA)*(valueB)+(ValueC)*(ValueD)))
intensitygx#=sqrt(ABS((valueE)*(valueF)+(ValueG)*(ValueH)))
intensitybx#=sqrt(ABS((valueI)*(valueJ)+(ValueK)*(ValueL)))
 
if intensityrx#>255 then intensityrx#=255
if intensitygx#>255 then intensitygx#=255
if intensitybx#>255 then intensitybx#=255
`If intensityrx#=255 and intensitygx#=255 and intensitybx#=255 then intensityrx#=0 : intensitygx#=0 : intensitybx#=0
DOT x,y,RGB(intensityrx#,intensitygx#,intensitybx#)
Next y
Next x
 
gosub drawbuttons
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : Print "Photo-Wave Effects Generator V2.1 - By Calcyman"
 
gosub drawvalues
unlock pixels
 
 
Do
ink 0,0
BOX 405,20,440,300
BOX 600,20,640,300
BOX 405,320,440,600
BOX 600,320,640,600
ink RGB(255,255,255),0
 
If cycle=1
INK 0,0
Box 0,404,400,450
INK RGB(255,0,0),0
Set cursor 10,410 : Print "Generating Random Pics - Click to stop"
INK RGB(255,255,255),0
For x = 1 to 100
If mouseclick()=1
cycle=0 : upd=0
 
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : Print "Photo-Wave Effects Generator V2.1 - By Calcyman"
 
Endif
Wait 10
Next x
Endif
 
gosub drawvalues
gosub mousecheck
 
 
 
If inkey$()="u" or upd=1
upd=0
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : Print "Generating new effect - Please wait"
exit
Endif
 
wait 50
Loop
inc loopcount
If seqtype=1 then wait key
If qsave=1 then get image 1,1,1,400,400 : save image ("calcyeffects/calcy"+STR$(loopcount)+".jpg"),1
If qsave=1 and loopcount>imgnum then end
goto ouch
 
drawbuttons:
 
buttonX=440
offset=10
buttonwidth=40
 
For y = 0 to 2
For x = 1 to 8
z = (buttonwidth+offset)*y
Paste image 89,buttonX+z,(x*30)-2 : buttons(x+(y*32),1)=buttonX+z : buttons(x+(y*32),2)=(x*30)-2
Paste image 89,buttonX+z,(x*30)+298 : buttons(x+(y*32)+8,1)=buttonX+z : buttons(x+8+(y*32),2)=(x*30)+298
Paste image 89,buttonX+200+z,(x*30)-2 : buttons(x+(y*32)+16,1)=buttonX+200+z : buttons(x+16+(y*32),2)=(x*30)-2
Paste image 89,buttonX+200+z,(x*30)+298 : buttons(x+(y*32)+24,1)=buttonX+200+z : buttons(x+24+(y*32),2)=(x*30)+298
Next x
Next y
 
For y = 1 to 5
For x = 1 to 3
paste image 90,(x*130)-120,(y*30)+418
Next x
Next y
 
 
INK RGB(255,255,255),0
 
For x = 1 to 8
 
SET CURSOR (1*50)+398,(x)*30 : print " + "
SET CURSOR (2*50)+398,(x)*30 : print " - "
SET CURSOR (3*50)+398,(x)*30 : print "Rnd"
 
SET CURSOR (1*50)+398,(x+10)*30 : print " + "
SET CURSOR (2*50)+398,(x+10)*30 : print " - "
SET CURSOR (3*50)+398,(x+10)*30 : print "Rnd"
 
SET CURSOR (1*50)+598,(x)*30 : print " + "
SET CURSOR (2*50)+598,(x)*30 : print " - "
SET CURSOR (3*50)+598,(x)*30 : print "Rnd"
 
SET CURSOR (1*50)+598,(x+10)*30 : print " + "
SET CURSOR (2*50)+598,(x+10)*30 : print " - "
SET CURSOR (3*50)+598,(x+10)*30 : print "Rnd"
 
 
Next x
SET CURSOR 18,450 : print "Update Effect"
SET CURSOR 18,480 : print "Randomise All"
SET CURSOR 18,510 : print "Random Series"
SET CURSOR 18,540 : print "  Load Data  "
SET CURSOR 18,570 : print " Save Effect "
 
SET CURSOR 148,450 : print "   R <-> G   "
SET CURSOR 148,480 : print "   G <-> B   "
SET CURSOR 148,510 : print "   B <-> R   "
SET CURSOR 148,540 : print "Batch Process"
SET CURSOR 152,570 : print "Exit Program"
 
SET CURSOR 282,450 : print " future use "
SET CURSOR 282,480 : print " future use "
SET CURSOR 282,510 : print " future use "
SET CURSOR 282,540 : print " future use "
SET CURSOR 282,570 : print " future use "
Return
 
mousecheck:
 
Set cursor 0,410
buttonpressed=0
If mouseclick()=1
cycle=0
 
For x = 1 to 96
 
If mousex()=>buttons(x,1) and mousex()<=buttons(x,1)+40 and mousey()=>buttons(x,2) and mousey()<=buttons(x,2)+20
 
buttonpressed=x
 
Endif
 
Next x
 
If buttonpressed>0
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : Print "Press [Update Effect] to see result"
Endif
 
If mousex()=>10 and mousex()<=130 and mousey()=>448 and mousey()<=468 then buttonpressed=97
If mousex()=>10 and mousex()<=130 and mousey()=>478 and mousey()<=498 then buttonpressed=98
If mousex()=>10 and mousex()<=130 and mousey()=>508 and mousey()<=528 then buttonpressed=99
If mousex()=>10 and mousex()<=130 and mousey()=>538 and mousey()<=558 then buttonpressed=100
If mousex()=>10 and mousex()<=130 and mousey()=>568 and mousey()<=588 then buttonpressed=101
 
If mousex()=>140 and mousex()<=260 and mousey()=>448 and mousey()<=468 then buttonpressed=102
If mousex()=>140 and mousex()<=260 and mousey()=>478 and mousey()<=498 then buttonpressed=103
If mousex()=>140 and mousex()<=260 and mousey()=>508 and mousey()<=528 then buttonpressed=104
If mousex()=>140 and mousex()<=260 and mousey()=>538 and mousey()<=558 then buttonpressed=105
If mousex()=>140 and mousex()<=260 and mousey()=>568 and mousey()<=588 then buttonpressed=106
 
If mousex()=>270 and mousex()<=390 and mousey()=>448 and mousey()<=468 then buttonpressed=107
If mousex()=>270 and mousex()<=390 and mousey()=>478 and mousey()<=498 then buttonpressed=108
If mousex()=>270 and mousex()<=390 and mousey()=>508 and mousey()<=528 then buttonpressed=109
If mousex()=>270 and mousex()<=390 and mousey()=>538 and mousey()<=558 then buttonpressed=110
If mousex()=>270 and mousex()<=390 and mousey()=>568 and mousey()<=588 then buttonpressed=111
Endif
 
If buttonpressed=1 then inc vartype(1,1)
If buttonpressed=2 then inc vartype(1,2)
If buttonpressed=3 then inc vartype(2,1)
If buttonpressed=4 then inc vartype(2,2)
If buttonpressed=5 then inc vartype(3,1)
If buttonpressed=6 then inc vartype(3,2)
If buttonpressed=7 then inc vartype(4,1)
If buttonpressed=8 then inc vartype(4,2)
If buttonpressed=9 then inc vartype(5,1)
If buttonpressed=10 then inc vartype(5,2)
If buttonpressed=11 then inc vartype(6,1)
If buttonpressed=12 then inc vartype(6,2)
If buttonpressed=13 then inc vartype(7,1)
If buttonpressed=14 then inc vartype(7,2)
If buttonpressed=15 then inc vartype(8,1)
If buttonpressed=16 then inc vartype(8,2)
If buttonpressed=17 then inc vartype(9,1)
If buttonpressed=18 then inc vartype(9,2)
If buttonpressed=19 then inc vartype(10,1)
If buttonpressed=20 then inc vartype(10,2)
If buttonpressed=21 then inc vartype(11,1)
If buttonpressed=22 then inc vartype(11,2)
If buttonpressed=23 then inc vartype(12,1)
If buttonpressed=24 then inc vartype(12,2)
If buttonpressed=25 then inc ax,10
If buttonpressed=26 then inc ay,10
If buttonpressed=27 then inc bx,10
If buttonpressed=28 then inc by,10
If buttonpressed=29 then inc ex,10
If buttonpressed=30 then inc ey,10
If buttonpressed=31 then inc j
If buttonpressed=32 then inc k
 
If buttonpressed=33 then dec vartype(1,1)
If buttonpressed=34 then dec vartype(1,2)
If buttonpressed=35 then dec vartype(2,1)
If buttonpressed=36 then dec vartype(2,2)
If buttonpressed=37 then dec vartype(3,1)
If buttonpressed=38 then dec vartype(3,2)
If buttonpressed=39 then dec vartype(4,1)
If buttonpressed=40 then dec vartype(4,2)
If buttonpressed=41 then dec vartype(5,1)
If buttonpressed=42 then dec vartype(5,2)
If buttonpressed=43 then dec vartype(6,1)
If buttonpressed=44 then dec vartype(6,2)
If buttonpressed=45 then dec vartype(7,1)
If buttonpressed=46 then dec vartype(7,2)
If buttonpressed=47 then dec vartype(8,1)
If buttonpressed=48 then dec vartype(8,2)
If buttonpressed=49 then dec vartype(9,1)
If buttonpressed=50 then dec vartype(9,2)
If buttonpressed=51 then dec vartype(10,1)
If buttonpressed=52 then dec vartype(10,2)
If buttonpressed=53 then dec vartype(11,1)
If buttonpressed=54 then dec vartype(11,2)
If buttonpressed=55 then dec vartype(12,1)
If buttonpressed=56 then dec vartype(12,2)
If buttonpressed=57 then dec ax,10
If buttonpressed=58 then dec ay,10
If buttonpressed=59 then dec bx,10
If buttonpressed=60 then dec by,10
If buttonpressed=61 then dec ex,10
If buttonpressed=62 then dec ey,10
If buttonpressed=63 then dec j
If buttonpressed=64 then dec k
 
If buttonpressed=65 then vartype(1,1)=RND(11)+1
If buttonpressed=66 then vartype(1,2)=RND(22)+1
If buttonpressed=67 then vartype(2,1)=RND(11)+1
If buttonpressed=68 then vartype(2,2)=RND(22)+1
If buttonpressed=69 then vartype(3,1)=RND(11)+1
If buttonpressed=70 then vartype(3,2)=RND(22)+1
If buttonpressed=71 then vartype(4,1)=RND(11)+1
If buttonpressed=72 then vartype(4,2)=RND(22)+1
If buttonpressed=73 then vartype(5,1)=RND(11)+1
If buttonpressed=74 then vartype(5,2)=RND(22)+1
If buttonpressed=75 then vartype(6,1)=RND(11)+1
If buttonpressed=76 then vartype(6,2)=RND(22)+1
If buttonpressed=77 then vartype(7,1)=RND(11)+1
If buttonpressed=78 then vartype(7,2)=RND(22)+1
If buttonpressed=79 then vartype(8,1)=RND(11)+1
If buttonpressed=80 then vartype(8,2)=RND(22)+1
If buttonpressed=81 then vartype(9,1)=RND(11)+1
If buttonpressed=82 then vartype(9,2)=RND(22)+1
If buttonpressed=83 then vartype(10,1)=RND(11)+1
If buttonpressed=84 then vartype(10,2)=RND(22)+1
If buttonpressed=85 then vartype(11,1)=RND(11)+1
If buttonpressed=86 then vartype(11,2)=RND(22)+1
If buttonpressed=87 then vartype(12,1)=RND(11)+1
If buttonpressed=88 then vartype(12,2)=RND(22)+1
If buttonpressed=89 then ax=RND(400)
If buttonpressed=90 then ay=RND(400)
If buttonpressed=91 then bx=RND(400)
If buttonpressed=92 then by=RND(400)
If buttonpressed=93 then ex=RND(400)
If buttonpressed=94 then ey=RND(400)
If buttonpressed=95 then j=RND(2)+1
If buttonpressed=96 then k=RND(2)+1
upd=0
If buttonpressed=97 then upd=1 : Return
If buttonpressed=98
 
ax=rnd(400)
ay=rnd(400)
bx=rnd(400)
by=rnd(400)
c=1000000
d=1000000
ex=rnd(400)
ey=rnd(400)
g=1000000
j=1
k=2
 
For x = 1 to 12
vartype(x,1)=rnd(11)+1
vartype(x,2)=rnd(22)+1
Next x
 
Endif
 
If cycle=1
 
ax=rnd(400)
ay=rnd(400)
bx=rnd(400)
by=rnd(400)
c=1000000
d=1000000
ex=rnd(400)
ey=rnd(400)
g=1000000
j=1
k=2
 
For x = 1 to 12
vartype(x,1)=rnd(11)+1
vartype(x,2)=rnd(22)+1
Next x
 
upd=1 : Return
 
Endif
 
If buttonpressed = 99 then cycle=1 : wait 500
 
If buttonpressed = 100
 
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : input "Filename of text file: ",loadfile$
If file exist(loadfile$+".txt")
Open to read 1,loadfile$+".txt"
 
For x = 1 to 12
Read string 1,diffusedata$
vartype(x,1)=VAL(diffusedata$)
Read string 1,diffusedata$
vartype(x,2)=VAL(diffusedata$)
Next x
 
 
Read string 1,diffusedata$
ax=VAL(diffusedata$)
Read string 1,diffusedata$
ay=VAL(diffusedata$)
Read string 1,diffusedata$
bx=VAL(diffusedata$)
Read string 1,diffusedata$
by=VAL(diffusedata$)
Read string 1,diffusedata$
ex=VAL(diffusedata$)
Read string 1,diffusedata$
ey=VAL(diffusedata$)
Read string 1,diffusedata$
j=VAL(diffusedata$)
Read string 1,diffusedata$
k=VAL(diffusedata$)
 
Close file 1
upd=1
Else
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : Print "Ohno! You haven't made that file yet!"
Endif
Endif
 
If buttonpressed = 101
 
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : Print "Grabbing image"
 
get image 100,1,1,400,400
 
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : INPUT "Type Filename (exc. extension): ",filename$
 
save image (filename$+".jpg"),100
 
Open to write 1,filename$+".txt"
 
For x = 1 to 12
(diffusedata$)=STR$(vartype(x,1))
write string 1,diffusedata$
(diffusedata$)=STR$(vartype(x,2))
write string 1,diffusedata$
Next x
 
 
diffusedata$ = STR$(ax)
write string 1,diffusedata$
diffusedata$ = STR$(ay)
write string 1,diffusedata$
diffusedata$ = STR$(bx)
write string 1,diffusedata$
diffusedata$ = STR$(by)
write string 1,diffusedata$
diffusedata$ = STR$(ex)
write string 1,diffusedata$
diffusedata$ = STR$(ey)
write string 1,diffusedata$
diffusedata$ = STR$(j)
write string 1,diffusedata$
diffusedata$ = STR$(k)
write string 1,diffusedata$
 
Close file 1
 
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : PRINT "Photo-Wave Effects Generator - By Calcyman"
 
Endif
 
If buttonpressed=102
For x = 1 to 4
cumul=vartype(x,1)+vartype(x+4,1)
vartype(x,1)=vartype(x+4,1)
vartype(x+4,1)=cumul-vartype(x,1)
cumul=vartype(x,2)+vartype(x+4,2)
vartype(x,2)=vartype(x+4,2)
vartype(x+4,2)=cumul-vartype(x,2)
Next x
upd=1
Endif
 
If buttonpressed=103
For x = 1 to 4
cumul=vartype(x+8,1)+vartype(x+4,1)
vartype(x+8,1)=vartype(x+4,1)
vartype(x+4,1)=cumul-vartype(x+8,1)
cumul=vartype(x+8,2)+vartype(x+4,2)
vartype(x+8,2)=vartype(x+4,2)
vartype(x+4,2)=cumul-vartype(x+8,2)
Next x
upd=1
Endif
 
If buttonpressed=104
For x = 1 to 4
cumul=vartype(x,1)+vartype(x+8,1)
vartype(x,1)=vartype(x+8,1)
vartype(x+8,1)=cumul-vartype(x,1)
cumul=vartype(x,2)+vartype(x+8,2)
vartype(x,2)=vartype(x+8,2)
vartype(x+8,2)=cumul-vartype(x,2)
Next x
upd=1
Endif
 
If buttonpressed=105
INK 0,0
Box 0,404,400,450
INK RGB(255,255,255),0
Set cursor 10,410 : INPUT "number of images",imgnum
loopcount=0
cycle=1 : qsave=1 : wait 500
Endif
 
If buttonpressed=106 then end
 
For x = 1 to 12
 
If vartype(x,1)>11 then vartype(x,1)=11
If vartype(x,1)<1 then vartype(x,1)=1
If vartype(x,2)>22 then vartype(x,2)=22
If vartype(x,2)<1 then vartype(x,2)=1
 
If ax>960 then ax=960
If ax<-960 then ax=-960
If bx>960 then bx=960
If bx<-960 then bx=-960
If by>960 then by=960
If by<-960 then by=-960
If ay>960 then ay=960
If ay<-960 then ay=-960
If ex>960 then ex=960
If ex<-960 then ex=-960
If ey>960 then ey=960
If ey<-960 then ey=-960
 
If j>10 then j = 10
If j<-10 then j = -10
If k>10 then k = 10
If k<-10 then k = -10
 
 
Next x
 
 
Return
 
drawvalues:
 
Set cursor 405,0
ink RGB(255,0,0),0
print "Red Diffuses:"
Set cursor 405,30 : print vartype(1,1)
Set cursor 405,60 : print vartype(1,2)
Set cursor 405,90 : print vartype(2,1)
Set cursor 405,120 : print vartype(2,2)
Set cursor 405,150 : print vartype(3,1)
Set cursor 405,180 : print vartype(3,2)
Set cursor 405,210 : print vartype(4,1)
Set cursor 405,240 : print vartype(4,2)
Set cursor 405,300
ink RGB(0,255,0),0
print "Green Diffuses:"
Set cursor 405,330 : print vartype(5,1)
Set cursor 405,360 : print vartype(5,2)
Set cursor 405,390 : print vartype(6,1)
Set cursor 405,420 : print vartype(6,2)
Set cursor 405,450 : print vartype(7,1)
Set cursor 405,480 : print vartype(7,2)
Set cursor 405,510 : print vartype(8,1)
Set cursor 405,540 : print vartype(8,2)
Set cursor 605,0
ink RGB(0,0,255),0
print "Blue Diffuses:"
Set cursor 605,30 : print vartype(9,1)
Set cursor 605,60 : print vartype(9,2)
Set cursor 605,90 : print vartype(10,1)
Set cursor 605,120 : print vartype(10,2)
Set cursor 605,150 : print vartype(11,1)
Set cursor 605,180 : print vartype(11,2)
Set cursor 605,210 : print vartype(12,1)
Set cursor 605,240 : print vartype(12,2)
Set cursor 605,300
ink RGB(255,255,255),0
print "Energy Positions:"
Set cursor 605,330 : print ax
Set cursor 605,360 : print ay
Set cursor 605,390 : print bx
Set cursor 605,420 : print by
Set cursor 605,450 : print ex
Set cursor 605,480 : print ey
Set cursor 605,510 : print j
Set cursor 605,540 : print k
 
Return