PowerShell/Scripts/write-sine-curves.ps1

23 lines
503 B
PowerShell
Raw Normal View History

2022-12-29 21:46:35 +01:00
<#
2022-10-25 20:26:18 +02:00
.SYNOPSIS
Write sine curves
.DESCRIPTION
This PowerShell script writes sine curves.
.EXAMPLE
PS> ./write-sine-curves
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
0..1000 | foreach {
$Value = [int](40 * [math]::sin($_ / 10))
if ($Value -gt 0) {
$Line = " "*60+"*"*$value
} else {
$Line = " "*(60-(-1*$value))+"*"*($value*-1)
}
Write-Host $Line
Start-Sleep -milliseconds 50
}