Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. $x = 0
  2. $y = 0
  3. $loop = 0
  4. $rawui = (Get-Host).ui.rawui
  5. for ($termination = $FALSE; $termination -eq $FALSE; ) {
  6. Start-Sleep 1
  7. #Clear-Host
  8. while ($rawui.KeyAvailable) {
  9. $keyinput = $rawui.Readkey("NoEcho,IncludeKeyUp")
  10. switch ($keyinput.Character) {
  11. 'q' { $termination = $TRUE }
  12. 'w' { $y++ }
  13. 'a' { $x-- }
  14. 's' { $y-- }
  15. 'd' { $x++ }
  16. }
  17. }
  18. $loop++
  19. "(x,y)=($x,$y) loop=$loop"
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement