Skip to content

Instantly share code, notes, and snippets.

@takai
Created June 19, 2018 12:14
Show Gist options
  • Save takai/0a3c673d7a6bb6689b5143533667f6f6 to your computer and use it in GitHub Desktop.
Save takai/0a3c673d7a6bb6689b5143533667f6f6 to your computer and use it in GitHub Desktop.
require 'io/console'
print('original: ')
original = STDIN.noecho(&:gets)
puts
loop do
print('input: ')
input = STDIN.noecho(&:gets)
puts
if original == input
puts "\e[32mOK\e[0m"
else
puts "\e[31mNG\e[0m"
end
rescue Interrupt
exit
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment