Sailors, coconuts and a monkey problem: Difference between revisions

m
m (syntax highlighting fixup automation)
(4 intermediate revisions by 2 users not shown)
Line 2,454:
 
0 OK, 0:127</pre>
 
=={{header|Uiua}}==
 
<syntaxhighlight lang="Uiua">
# Produce candidate list of final numbers
⊚=0◿5⇡2000
# Five times: only keep piles that can be split by 4, do so,
# multiply by five and add one. Return the first value.
⊢⍥(+1×5÷4⊏⊚=0◿4.)5
 
⊚=0◿6⇡100000
⊢⍥(+1×6÷5⊏⊚=0◿5.)6
</syntaxhighlight>
{{out}}
<pre>
3121
233275
</pre>
 
Or for a terse point-free loop through different numbers of sailors:
<syntaxhighlight lang="Uiua">
+2⇡7
≡(
↘1×,⇡10000000
⊟:⊢⍥(+1×+1⟜÷⟜(⊏⊚=0◿)-1:,,),
)
</syntaxhighlight>
{{out}}
<pre>
╭─
╷ 2 11
3 25
4 765
5 3121
6 233275
7 823537
8 117440505
</pre>
 
=={{header|VBA}}==
Line 2,494 ⟶ 2,533:
=={{header|Wren}}==
{{trans|Kotlin}}
<syntaxhighlight lang="ecmascriptwren">var coconuts = 11
for (ns in 2..9) {
var hidden = List.filled(ns, 0)
106

edits