Skip to content

Instantly share code, notes, and snippets.

@HorlogeSkynet
Last active August 21, 2017 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HorlogeSkynet/16f3fdc20f1546f7a46ef90dffee6d3e to your computer and use it in GitHub Desktop.
Save HorlogeSkynet/16f3fdc20f1546f7a46ef90dffee6d3e to your computer and use it in GitHub Desktop.
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