Sudan function: Difference between revisions
Content added Content deleted
(Add Factor) |
m (oops, remove extra header) |
||
Line 384: | Line 384: | ||
Or with locals: |
Or with locals: |
||
=={{header|Factor}}== |
|||
{{works with|Factor|0.99 2022-04-03}} |
|||
<lang factor>USING: combinators kernel locals math prettyprint ; |
<lang factor>USING: combinators kernel locals math prettyprint ; |
||
Line 393: | Line 391: | ||
{ [ y zero? ] [ x ] } |
{ [ y zero? ] [ x ] } |
||
[ n 1 - n x y 1 - sudan dup y + sudan ] |
[ n 1 - n x y 1 - sudan dup y + sudan ] |
||
} cond ; |
} cond ;</lang> |
||
3 1 1 sudan .</lang> |
|||
{{out}} |
|||
<pre> |
|||
10228 |
|||
</pre> |
|||
=={{header|FreeBASIC}}== |
=={{header|FreeBASIC}}== |