Last active
August 21, 2017 07:52
-
-
Save HorlogeSkynet/16f3fdc20f1546f7a46ef90dffee6d3e to your computer and use it in GitHub Desktop.
Code for TI-89 that simulates a random pixalisation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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