RosettaCodeData/Task/Fibonacci-sequence/PowerShell/fibonacci-sequence-1.psh

10 lines
175 B
Text
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
function FibonacciNumber ( $count )
{
$answer = @(0,1)
while ($answer.Length -le $count)
{
$answer += $answer[-1] + $answer[-2]
2013-04-10 22:43:41 -07:00
}
2016-12-05 22:15:40 +01:00
return $answer
2013-04-10 22:43:41 -07:00
}