Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0..100 | foreach {
- $value=[int](30*[math]::sin($_/10))
- if ($value -gt 0) {
- $wprint=” “*70+”*”*$value
- write-host $wprint}
- else {
- $wprint=” “*(70-(-1*$value))+”*”*($value*-1)
- write-host $wprint
- }
- }
- The above script draws a sinusoid wave on the text screen and it is in portrait mode.
- The following code draws a sinusoid wave on the current graphical screen using the mouse cursor:
- Add-Type -AssemblyName System.Windows.Forms
- Add-Type -AssemblyName System.Drawing
- 0..900 | foreach {
- $value=[int](50*[math]::sin($_/20))
- if ($value -gt 0) {
- [int]$location=300+$value }
- else {
- [int]$location=300-($value*-1)
- }
- $Position = [System.Drawing.Point]::new(100+$_,$location)
- [System.Windows.Forms.Cursor]::Position = $Position
- for($i=1; $i -le 10000; $i++) {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement