Sturmian word: Difference between revisions

m
(→‎{{header|Wren}}: Modified to deal with Sturmian words derived from quadratric as well as rational numbers.)
Line 27:
 
== {{header|Phix}} ==
Rational part translated from Python, quadratic part modified from the [[Continued fraction convergents]] task.
{{trans|Python}}
<!--(phixonline)-->
<syntaxhighlight lang="Phix">
Line 61:
sturmian = sturmian_word(13, 21)
assert(fib[1..length(sturmian)] == sturmian)
?printf(1," %s <== 13/21\n",sturmian)
 
function cfck(integer a, b, m, n, k)
Line 85:
{{out}}
<pre>
" 01001010010010100101001001010010" <== 13/21
01001010010010100101001001010010 <== 1/phi (8th convergent)
</pre>
7,818

edits