A program inserted within other graphics programs to allow standard graph navigation for image placement.
Variables k, x and y must not be local
This is for a screen resolution of 159x77
keyarrow()
:Prgm:Goto #("k"&string(exact(k)))
:Lbl k337:If x≠0:x-1→x:Goto e
:Lbl k340:If x≠158:x+1→x:Goto e
:Lbl k338:If y≠0:y-1→y:Goto e
:Lbl k344:If y≠76:y+1→y:Goto e
:Lbl k339:If x≠0 and y≠0 Then:x-1→x:y-1→y:EndIf:Goto e
:Lbl k345:If x≠0 and y≠76 Then:x-1→x:y+1→y:EndIf:Goto e
:Lbl k342:If x≠158 and y≠0 Then:x+1→x:y-1→y:EndIf:Goto e
:Lbl k348:If x≠158 and y≠76 Then:x+1→x:y+1→y:EndIf:Goto e
:Lbl k4433:If x≥10:x-10→x:Goto e
:Lbl k4436:If x≤148:x+10→x:Goto e
:Lbl k4434:If y≥10:y-10→y:Goto e
:Lbl k4440:If y≤66:y+10→y:Goto e
:Lbl k4435:If x≥10 and y≥10 Then:x-10→x:y-10→y:EndIf:Goto e
:Lbl k4441:If x≥10 and y≤66 Then:x-10→x:y+10→y:EndIf:Goto e
:Lbl k4438:If x≤148 and y≥10 Then:x+10→x:y-10→y:EndIf:Goto e
:Lbl k4444:If x≤148 and y≤66 Then:x+10→x:y+10→y:EndIf:Goto e
:Lbl 13:Lbl k4109: Lbl k0:Lbl e:EndPrgm
Variables k, x and y must not be local
This is for a screen resolution of 159x77
keyarrow()
:Prgm:Goto #("k"&string(exact(k)))
:Lbl k337:If x≠0:x-1→x:Goto e
:Lbl k340:If x≠158:x+1→x:Goto e
:Lbl k338:If y≠0:y-1→y:Goto e
:Lbl k344:If y≠76:y+1→y:Goto e
:Lbl k339:If x≠0 and y≠0 Then:x-1→x:y-1→y:EndIf:Goto e
:Lbl k345:If x≠0 and y≠76 Then:x-1→x:y+1→y:EndIf:Goto e
:Lbl k342:If x≠158 and y≠0 Then:x+1→x:y-1→y:EndIf:Goto e
:Lbl k348:If x≠158 and y≠76 Then:x+1→x:y+1→y:EndIf:Goto e
:Lbl k4433:If x≥10:x-10→x:Goto e
:Lbl k4436:If x≤148:x+10→x:Goto e
:Lbl k4434:If y≥10:y-10→y:Goto e
:Lbl k4440:If y≤66:y+10→y:Goto e
:Lbl k4435:If x≥10 and y≥10 Then:x-10→x:y-10→y:EndIf:Goto e
:Lbl k4441:If x≥10 and y≤66 Then:x-10→x:y+10→y:EndIf:Goto e
:Lbl k4438:If x≤148 and y≥10 Then:x+10→x:y-10→y:EndIf:Goto e
:Lbl k4444:If x≤148 and y≤66 Then:x+10→x:y+10→y:EndIf:Goto e
:Lbl 13:Lbl k4109: Lbl k0:Lbl e:EndPrgm
Removes anything visual from the graph display.
graphoff()
:Prgm
:FnOff
:ClrDraw
:setGraph("Grid","OFF")
:setGraph("Axes","OFF")
:setGraph("Labels","OFF")
:EndPrgm
graphoff()
:Prgm
:FnOff
:ClrDraw
:setGraph("Grid","OFF")
:setGraph("Axes","OFF")
:setGraph("Labels","OFF")
:EndPrgm
Moves a point on the graph screen until activated by hitting enter, the point can then be moved freely to draw until hitting enter a second time.
pen()
:Prgm
:Local i,j
:StoPic j
:0→i
:75→x
:34→y
:Loop
:getKey()→k
:If i=0
:RplcPic j
:keyarrow() © (first program above)
:PxlOn y,x
:If k=13 and i=1
:Goto e
:If k=13 and i=0
:1→i
:EndLoop
:Lbl e
:DelVar k,x,y
:EndPrgm
pen()
:Prgm
:Local i,j
:StoPic j
:0→i
:75→x
:34→y
:Loop
:getKey()→k
:If i=0
:RplcPic j
:keyarrow() © (first program above)
:PxlOn y,x
:If k=13 and i=1
:Goto e
:If k=13 and i=0
:1→i
:EndLoop
:Lbl e
:DelVar k,x,y
:EndPrgm
Adds saved picture to graph display in selected position.
addpic()
:Prgm
:Local i
:StoPic i
:0→x
:0→y
:Loop
:getkey()→k
:RplcPic i
:RclPic #p,y,x
:If k=13
:StoPic i
:If k=4109
:Goto e
:keyarrow() © (first program above)
:EndLoop
:Lbl e
:DelVar k,x,y
:EndPrgm
addpic()
:Prgm
:Local i
:StoPic i
:0→x
:0→y
:Loop
:getkey()→k
:RplcPic i
:RclPic #p,y,x
:If k=13
:StoPic i
:If k=4109
:Goto e
:keyarrow() © (first program above)
:EndLoop
:Lbl e
:DelVar k,x,y
:EndPrgm
Allows placement of a rectangle in the graph display in a position and size of choice. Plot is a solid 3x3 box, it must be saved to use this program the way it has been set up.
box()
:Prgm
:Local i,ξ,ψ
:StoPic i
:78→x
:37→y
:Loop
:getKey()→k
:RplcPic i
:keyarrow() © (first program above)
:RclPic plot,y,x
:If k=13
:Goto m
:EndLoop
:Lbl m
:x+1→ξ
:y+1→ψ
:Loop
:getKey()→k
:RplcPic i
:keyarrow()
:If k≠13
:RclPic plot,y,x
:PxlLine ψ,ξ,ψ,x+1
:PxlLine ψ,ξ,y+1,ξ
:PxlLine y+1,ξ,y+1,x+1
:PxlLine ψ,x+1,y+1,x+1
:If k=13
:Goto e
:EndLoop
:Lbl e
:DelVar k,x,y
:EndPrgm
box()
:Prgm
:Local i,ξ,ψ
:StoPic i
:78→x
:37→y
:Loop
:getKey()→k
:RplcPic i
:keyarrow() © (first program above)
:RclPic plot,y,x
:If k=13
:Goto m
:EndLoop
:Lbl m
:x+1→ξ
:y+1→ψ
:Loop
:getKey()→k
:RplcPic i
:keyarrow()
:If k≠13
:RclPic plot,y,x
:PxlLine ψ,ξ,ψ,x+1
:PxlLine ψ,ξ,y+1,ξ
:PxlLine y+1,ξ,y+1,x+1
:PxlLine ψ,x+1,y+1,x+1
:If k=13
:Goto e
:EndLoop
:Lbl e
:DelVar k,x,y
:EndPrgm
Flips the graph display horizontally.
fliphorz()
:Prgm
:Local i
:For i,0,158
:StoPic #("m"&string(exact(i))),0,i,1,77
:EndFor
:graphoff() © (second program above)
:For i,0,158
:RclPic #("m"&string(exact(i))),0,158-i
:EndFor
:For i,0,158
:DelVar #("m"&string(exact(i)))
:EndFor
:EndPrgm
fliphorz()
:Prgm
:Local i
:For i,0,158
:StoPic #("m"&string(exact(i))),0,i,1,77
:EndFor
:graphoff() © (second program above)
:For i,0,158
:RclPic #("m"&string(exact(i))),0,158-i
:EndFor
:For i,0,158
:DelVar #("m"&string(exact(i)))
:EndFor
:EndPrgm
Flips the graph display vertically.
flipvert()
:Prgm
:Local i
:For i,0,76
:StoPic #("m"&string(exact(i))),i,0,159,1
:EndFor
:graphoff() © (second program above)
:For i,0,76
:RclPic #("m"&string(exact(i))),76-i,0
:EndFor
:For i,0,76
:DelVar #("m"&string(exact(i)))
:EndFor
:EndPrgm
flipvert()
:Prgm
:Local i
:For i,0,76
:StoPic #("m"&string(exact(i))),i,0,159,1
:EndFor
:graphoff() © (second program above)
:For i,0,76
:RclPic #("m"&string(exact(i))),76-i,0
:EndFor
:For i,0,76
:DelVar #("m"&string(exact(i)))
:EndFor
:EndPrgm
Creates a noise effect on the graph display which eventually appears as static. This is an endless loop which must be broken manually.
decay(t)
:Prgm
:Local i
:If t=-1 Then
:Loop
:PxlChg rand(77)-1,rand(159)-1
:EndLoop
:EndIf
:If t=0 Then
:Loop
:PxlOff rand(77)-1,rand(159)-1
:EndLoop
:EndIf
:If t=1 Then
:Loop
:PxlOn rand(77)-1,rand(159)-1
:EndLoop
:EndIf
:EndPrgm
decay(t)
:Prgm
:Local i
:If t=-1 Then
:Loop
:PxlChg rand(77)-1,rand(159)-1
:EndLoop
:EndIf
:If t=0 Then
:Loop
:PxlOff rand(77)-1,rand(159)-1
:EndLoop
:EndIf
:If t=1 Then
:Loop
:PxlOn rand(77)-1,rand(159)-1
:EndLoop
:EndIf
:EndPrgm