Applications 17–7
82501F~1.DOC TI-83 international English Bob Fedorisko Revised: 10/26/05 1:49 PM Printed: 10/27/05 3:04
PM Page 7 of 20
This program creates a drawing of a famous fractal, the
Sierpinski Triangle, and stores the drawing to a picture. To
begin, press ~ ~
1. Name the program SIERPINS, and
then press Í. The program editor is displayed.
PROGRAM:SIERPINS
:FnOff :ClrDraw
:PlotsOff
:AxesOff
:0!
!!
!Xmin:1!
!!
!Xmax
:0!
!!
!Ymin:1!
!!
!Ymax
Set viewing window.
:rand!
!!
!X:rand!
!!
!Y
:For(K,1,3000)
:rand!
!!
!N
Beginning of For group.
:If N1 à 3
:Then
:.5X!
!!
!X
:.5Y!
!!
!Y
:End
If/Then group
:If 1 à 3 <N and N2 à 3
:Then
:.5(.5+X)!
!!
!X
:.5(1+Y)!
!!
!Y
:End
If/Then group.
:If 2 à 3<N
:Then
:.5(1+X)!
!!
!X
:.5Y!
!!
!Y
:End
If/Then group.
:Pt-On(X,Y) Draw point.
:End End of For group.
:StorePic 6 Store picture.
After you execute the program above, you can recall and display
the picture with the instruction
RecallPic 6.
Using a Program to Create the Sierpinski Triangle
Setting up the
Program
Program