Quick actions

cmd+k|ctrl+k

Navigation

Languages

Man or boy

Snippet info

Language

Raku

Visibility

public

Author

raiph

Created

2024-04-03T22:30:08.651585Z

Updated

2024-04-03T23:12:28.42816Z

# Based on https://rosettacode.org/wiki/Man_or_boy_test#Raku (April 2024)
sub A($k is copy, \x1, \x2, \x3, &x4, &x5) {
    my &B = { A --$k, &?BLOCK, x1, x2, x3, &x4 }
    $k ≤ 0 ?? x4() + x5() !! B
}
 
say A 13, {1}, {-1}, {-1}, {1}, {0}
say now - INIT now;
say A 19, {1}, {-1}, {-1}, {1}, {0}
say now - INIT now;
INFO