Newer
Older
Ruby / 2022.rb
@HIROSE Yuuji HIROSE Yuuji on 1 Jan 2022 592 bytes 2022-01-01 00:11:56
#!/usr/bin/env ruby

txt = IO.readlines("2022.txt").join
gantan = IO.readlines("gantan.txt")

def clear
  print("\e[2J\e[1;1H")
end
def red
  print("\e[31;46m")
end
def normal
  print("\e[m")
end

=begin
3.times do
  clear
  print txt
  sleep 1
  clear
  print txt.gsub("M", " ")
  sleep 1
end
=end
while Time.now.strftime("%T") != "23:59:50"
  printf("%s\r", Time.now.strftime("%T"))
  sleep 0.3
end
10.downto(1) do |x|
  system("echo #{x} | kbanner -s")
  sleep 1
end

i = 0
red
while i < gantan.length
  if i<16
    red
  else
    normal
  end
  print(gantan[i])
  sleep 0.5
  i += 1
end