mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-14 14:58:47 +02:00
Rename folder Docs to docs
This commit is contained in:
46
docs/list-fibonacci.md
Normal file
46
docs/list-fibonacci.md
Normal file
@ -0,0 +1,46 @@
|
||||
*list-fibonacci.ps1*
|
||||
================
|
||||
|
||||
list-fibonacci.ps1
|
||||
|
||||
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
Script Content
|
||||
--------------
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the Fibonacci numbers
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the first 100 Fibonacci numbers.
|
||||
.EXAMPLE
|
||||
PS> ./list-fibonacci.ps1
|
||||
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ...
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
function fibonacci($n) {
|
||||
if ($n -lt 2) { return 1 }
|
||||
return (fibonacci($n - 1)) + (fibonacci($n - 2))
|
||||
}
|
||||
|
||||
|
||||
foreach ($i in 0..100) {
|
||||
Write-Host "$(fibonacci $i), " -noNewline
|
||||
}
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of list-fibonacci.ps1 as of 10/19/2023 08:11:39)*
|
Reference in New Issue
Block a user