Sierpinski triangle/Graphical: Difference between revisions

Content added Content deleted
mNo edit summary
(added FreeBasic)
Line 410: Line 410:
</lang>
</lang>


=={{header|FreeBASIC}}==
<lang FreeBASIC>' version 06-07-2015
' compile with: fbc -s console or with: fbc -s gui

#Define black 0
#Define white RGB(255,255,255)

Dim As Integer x, y
Dim As Integer order = 9
Dim As Integer size = 2 ^ order

ScreenRes size, size, 32
Line (0,0) - (size -1, size -1), black, bf

For y = 0 To size -1
For x = 0 To size -1
If (x And y) = 0 Then PSet(x, y) ' ,white
Next
Next

' empty keyboard buffer
While Inkey <> "" : Var _key_ = Inkey : Wend
WindowTitle "Hit any key to end program"
Sleep
End</lang>
=={{header|gnuplot}}==
=={{header|gnuplot}}==
Generating X,Y coordinates by the ternary digits of parameter t.
Generating X,Y coordinates by the ternary digits of parameter t.