Quick actions

cmd+k|ctrl+k

Navigation

Languages

lucas-numbers/lucas-08.p6

Snippet info

Language

Raku

Visibility

public

Author

zostay

Created

2016-08-29T16:31:33Z

Updated

2016-08-29T16:31:33Z

multi lucas(0) returns UInt { 2 }
multi lucas(1) returns UInt { 1 }
multi lucas(UInt $nth) returns UInt {
    lucas($nth - 1) + lucas($nth - 2)
}

say lucas(10);
INFO