100 doors: Difference between revisions
Content deleted Content added
m Fixed ultra optimized Python version |
Langurmonkey (talk | contribs) |
||
Line 7,868: | Line 7,868: | ||
=={{header|langur}}== |
=={{header|langur}}== |
||
=== not optimized === |
=== not optimized === |
||
⚫ | |||
{{works with|langur|0.8}} |
|||
⚫ | |||
for .i of .doors { |
for .i of .doors { |
||
Line 7,880: | Line 7,879: | ||
Or, we could use the foldfrom() function to produce the output. |
Or, we could use the foldfrom() function to produce the output. |
||
<syntaxhighlight lang="langur">writeln foldfrom( |
<syntaxhighlight lang="langur">writeln foldfrom(fn(.a, .b, .c) if(.b: .a~[.c]; .a), [], .doors, series 1..len .doors)</syntaxhighlight> |
||
=== optimized === |
=== optimized === |
||
<syntaxhighlight lang="langur">writeln map |
<syntaxhighlight lang="langur">writeln map fn{^2}, 1..10</syntaxhighlight> |
||
{{works with|langur|0.8.11}} |
|||
<syntaxhighlight lang="langur">writeln map f{^2}, 1..10</syntaxhighlight> |
|||
{{out}} |
{{out}} |