Sunflower fractal: Difference between revisions

Content added Content deleted
(Added C++ solution)
Line 408: Line 408:


=={{header|Phix}}==
=={{header|Phix}}==
{{libheader|Phix/pGUI}}
<lang Phix>constant numberofseeds = 3000
<lang Phix>constant numberofseeds = 3000


Line 444: Line 445:
cdCanvasSetForeground(cddbuffer, CD_BLACK)
cdCanvasSetForeground(cddbuffer, CD_BLACK)
return IUP_DEFAULT
return IUP_DEFAULT
end function

function esc_close(Ihandle /*ih*/, atom c)
if c=K_ESC then return IUP_CLOSE end if
return IUP_CONTINUE
end function
end function


Line 460: Line 456:
dlg = IupDialog(canvas)
dlg = IupDialog(canvas)
IupSetAttribute(dlg, "TITLE", "Sunflower")
IupSetAttribute(dlg, "TITLE", "Sunflower")
IupCloseOnEscape(dlg)
IupSetCallback(dlg, "K_ANY", Icallback("esc_close"))
IupSetCallback(canvas, "ACTION", Icallback("redraw_cb"))
IupSetCallback(canvas, "ACTION", Icallback("redraw_cb"))