Created
June 19, 2018 12:14
-
-
Save takai/0a3c673d7a6bb6689b5143533667f6f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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