Discussion forum about PANORAMIC language
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Discussion forum about PANORAMIC language

Mac, Windows & Android application development with PANORAMIC language
 
HomeHome  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  
Latest topics
» What happened with the panoramic language ?
by Wed Jan 03, 2024 4:09 pm

» Hello world.
by Wed May 09, 2018 11:53 pm

» Biomorphes de PICKOVER
by Sun Jun 18, 2017 2:33 am

» In less than 10 lines of code
by Fri Jun 16, 2017 5:03 am

» Effect Dopler
by Fri Jun 16, 2017 3:29 am

» SuperEllipse
by Wed Jun 14, 2017 4:01 am

» Plants
by Wed Jun 14, 2017 3:38 am

» Mira's attractor
by Wed Jun 14, 2017 3:30 am

» Triangle of Sierpinski
by Wed Jun 14, 2017 3:22 am

» Esthétique polaire
by Wed Jun 14, 2017 3:16 am

» Butterfly effect : Lorenz equations
by Wed Jun 14, 2017 3:08 am

» Collision detection
by Tue Jun 13, 2017 5:09 am

» The Bees Laline Paull Epub Books
by Mon Oct 10, 2016 8:58 pm

» PANORAMIC for Mac OSX 10 is available
by Tue Aug 09, 2016 6:08 pm

» ide
by Sat Jul 16, 2016 12:27 am

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

 

  Triangle of Sierpinski

Go down 
AuthorMessage
papydall

papydall


Number of posts : 39
Age : 73
Localisation : TUNISIA
Registration date : 2013-03-16

 Triangle of Sierpinski Empty
PostSubject: Triangle of Sierpinski    Triangle of Sierpinski EmptyWed Jun 14, 2017 3:22 am

Code:

rem ============================================================================
rem              Triangle of Sierpinski
rem                  By Papydall
rem ============================================================================

dim p(3,2), px, py, point%
p(1,1)=320
p(1,2)=0

p(2,1)=640
p(2,2)=512

p(3,1)=0
p(3,2)=512

px=int(rnd(640))
py=int(rnd(512))

width 0,700 : height 0,600 : color 0,0,0,0
2d_pen_color 255,0,0 : 2d_fill_color 255,0,0
caption 0,"Triangle of Sierpinski ... <ESC> to stop ..."
repeat
  point%=max(min(3,int(rnd(3)+1)),1)
  px=int(((p(point%,1)-px)*0.5)+px)
  py=int(((p(point%,2)-py)*0.5)+py)
  2d_circle px+20,py+20,1 : display
until scancode = 27
terminate
rem ============================================================================
Back to top Go down
 
Triangle of Sierpinski
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Discussion forum about PANORAMIC language :: Panoramic for Windows :: Source code (snippets)-
Jump to: