hexaflexagonImage.frink

Download or view hexaflexagonImage.frink in plain text format


g = new graphics

images = new array
images@0 = new image["file:kittyface.jpg"]
images@1 = new image["file:trs80iiib.jpg"]
images@2 = new image["file:circle.jpg"]

p = new filledPolygon
p.addPoint[0,0]
p.addPoint[1,0]
p.addPoint[1/2, -sqrt[3]/2]

for x=0 to 18
{
   g.save[]
   g.translate[x/2, 0]
   if x mod 2 == 1
      g.rotate[180 degrees, 1/2, -sqrt[3]/4]

   g.clip[p]
   g.fillCenter[images@(x mod length[images]), 1/2, -sqrt[3]/4, 1, sqrt[3]/2]
   g.restore[]
}

g.show[100 percent]

f = "hexaflexagon"
g.write["$f.svg", 2000, 200]
browse["$f.svg"]
g.write["$f.html", 2000, 200]
browse["$f.html"]
//g.printTiled[2,1, 100 percent]


Download or view hexaflexagonImage.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20217 days, 23 hours, 38 minutes ago.