Non-transitive dice: Difference between revisions

m
→‎{{header|Phix}}: progress() now a builtin
(Promote to full task status)
m (→‎{{header|Phix}}: progress() now a builtin)
Line 784:
return sign(res)
end function
 
integer lp = 0 -- (last progress length, to be wiped out)
procedure progress(string msg, sequence args = {})
if length(args) then msg = sprintf(msg,args) end if
integer lm = length(msg)
if lm=0 then
puts(1,repeat(' ',lp))
lp = 0
else
if lm<lp then msg[$..$] = repeat(' ',lp-lm)&msg[$] end if
puts(1,msg)
lp = iff(msg[$]='\r'?lm:0)
end if
end procedure
 
function low_rotation(sequence set)
7,805

edits