Jump to content

Galton box animation: Difference between revisions

m
m (→‎{{header|REXX}}: elided text from the REXX section that is no longer true (concerning the name of the program to clear the terminal screen).)
Line 2,476:
 
=={{header|Phix}}==
=== console ===
First, a console version:
<lang Phix>constant balls = 80
Line 2,547 ⟶ 2,548:
.......................
</pre>
=== gui ===
Also, here is a slightly nicer and resize-able gui version:
{{libheader|Phix/pGUI}}
<lang Phix>-- demo\rosetta\GaltonBox.exw
-- demo\rosetta\GaltonBox.exw
--
constant TITLE = "Galton Box"
 
Line 2,629:
cdCanvasSetBackground(cddbuffer, CD_GREY)
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
 
Line 2,648 ⟶ 2,643:
dlg = IupDialog(canvas)
IupSetAttribute(dlg, "TITLE", TITLE)
IupCloseOnEscape(dlg)
IupSetCallback(dlg, "K_ANY", Icallback("esc_close"))
 
IupShow(dlg)
IupSetAttribute(canvas, "RASTERSIZE", NULL)
7,820

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.