Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code for TI-89 that simulates a random pixalisation
Prgm
setGraph("axes", "off")
ClrDraw
38->x
79->y
0->t
While t < 5000
t+1->t
iPart(4*rand()+1)->pix
If pix=1 Then
x+1->x
If x>76 Then
0->x
EndIf
ElseIf pix=2 Then
x-1->x
If x<0 Then
76->x
EndIf
ElseIf pix=3 Then
y+1->y
If y>158 Then
0->y
EndIf
Else
y-1->y
If y<0 Then
158->y
EndIf
EndIf
If pxlTest(x,y) Then
PxlOff x,y
Else
PxlOn x,y
EndIf
EndWhile
ClrDraw
setGraph("axes", "on")
DelVar x,y,pix,t
EndPrgm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.