Use constant for clear screen esc code

This commit is contained in:
Anton Vakhrushev 2019-10-08 17:03:24 +03:00
parent b29c35b91b
commit acba0b2328

View File

@ -113,7 +113,9 @@ def normalize_command(cmd)
cmd.downcase.gsub(/\s+/, ' ').strip cmd.downcase.gsub(/\s+/, ' ').strip
end end
printf "\u{001b}[2J" CLEAR_SCREEN_ESC_CODE = "\u{001b}[2J"
printf CLEAR_SCREEN_ESC_CODE
loop do loop do
render_world world render_world world
printf "In > " printf "In > "
@ -122,7 +124,7 @@ loop do
if norm == "exit" if norm == "exit"
break break
end end
printf "\u{001b}[2J" printf CLEAR_SCREEN_ESC_CODE
current_time = Time.local.to_unix current_time = Time.local.to_unix
world.run current_time world.run current_time
begin begin