Skip to content

Instantly share code, notes, and snippets.

@Vindaar
Last active February 22, 2018 15:59
Show Gist options
  • Save Vindaar/fcf313f9f68491b505733bbd5bea562e to your computer and use it in GitHub Desktop.
Save Vindaar/fcf313f9f68491b505733bbd5bea562e to your computer and use it in GitHub Desktop.
proc get_password(): string =
echo "Enter password: "
result = ""
var ch = getch()
while ch != '\r':
result &= $ch
ch = getch()
when isMainModule:
let password = get_password()
echo "Entered password was ", password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment