Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $x = 0
- $y = 0
- $loop = 0
- $rawui = (Get-Host).ui.rawui
- for ($termination = $FALSE; $termination -eq $FALSE; ) {
- Start-Sleep 1
- #Clear-Host
- while ($rawui.KeyAvailable) {
- $keyinput = $rawui.Readkey("NoEcho,IncludeKeyUp")
- switch ($keyinput.Character) {
- 'q' { $termination = $TRUE }
- 'w' { $y++ }
- 'a' { $x-- }
- 's' { $y-- }
- 'd' { $x++ }
- }
- }
- $loop++
- "(x,y)=($x,$y) loop=$loop"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement