Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

PowerShell, 111 bytes

#PowerShell, 111 bytes ThereThere is probably a better way to do this, but I can't see it at the moment.

while(($x=($x+$host.UI.RawUI.ReadKey("IncludeKeyDown").character+" ").substring(1,5)).CompareTo("hello")){}

This reads the key strokes without supressing the echo. The character is added to $x which is trimmed to the last 5 characters and compared to "hello". This carries on until the comparison is true.

Note: this does not work in the PowerShell ISE. ReadKey is disabled in that environment.

#PowerShell, 111 bytes There is probably a better way to do this, but I can't see it at the moment.

while(($x=($x+$host.UI.RawUI.ReadKey("IncludeKeyDown").character+" ").substring(1,5)).CompareTo("hello")){}

This reads the key strokes without supressing the echo. The character is added to $x which is trimmed to the last 5 characters and compared to "hello". This carries on until the comparison is true.

Note: this does not work in the PowerShell ISE. ReadKey is disabled in that environment.

PowerShell, 111 bytes

There is probably a better way to do this, but I can't see it at the moment.

while(($x=($x+$host.UI.RawUI.ReadKey("IncludeKeyDown").character+" ").substring(1,5)).CompareTo("hello")){}

This reads the key strokes without supressing the echo. The character is added to $x which is trimmed to the last 5 characters and compared to "hello". This carries on until the comparison is true.

Note: this does not work in the PowerShell ISE. ReadKey is disabled in that environment.

Source Link
MickyT
  • 12.3k
  • 2
  • 27
  • 49

#PowerShell, 111 bytes There is probably a better way to do this, but I can't see it at the moment.

while(($x=($x+$host.UI.RawUI.ReadKey("IncludeKeyDown").character+" ").substring(1,5)).CompareTo("hello")){}

This reads the key strokes without supressing the echo. The character is added to $x which is trimmed to the last 5 characters and compared to "hello". This carries on until the comparison is true.

Note: this does not work in the PowerShell ISE. ReadKey is disabled in that environment.

AltStyle によって変換されたページ (->オリジナル) /