Jump to content

Sierpinski pentagon: Difference between revisions

Added solution for Action!
(Added solution for Action!)
Line 7:
* [http://ecademy.agnesscott.edu/~lriddle/ifs/pentagon/pentagon.htm Sierpinski pentagon]
<br><br>
 
=={{header|Action!}}==
<lang Action!>PROC Main()
INT ARRAY xs=[249 200 96 80 175]
BYTE ARRAY ys=[82 176 159 55 7]
INT x,y
BYTE i,CH=$02FC,COLOR1=$02C5,COLOR2=$02C6
 
Graphics(8+16)
Color=1
COLOR1=$0C
COLOR2=$02
 
x=160+Rand(30)
y=96+Rand(30)
DO
i=Rand(5)
x=x+(xs(i)-x)*62/100
y=y+(ys(i)-y)*62/100
Plot(x,y)
UNTIL CH#$FF
OD
CH=$FF
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Sierpinski_pentagon.png Screenshot from Atari 8-bit computer]
 
=={{header|AutoHotkey}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.