Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'time'
- # GMT+9 August 9, 1945 11:02am
- lastBoom = Time.new(1945,8,9,11,2,0,"+09:00")
- secSince = Time.new - lastBoom
- daysSince = secSince / 86400
- lines = [
- "+++ SAFETY FIRST +++",
- "",
- "This planet has gone",
- "[ #{daysSince.to_i} ] DAYS",
- "without a nuclear war",
- "",
- "+++ SAFETY FIRST +++"
- ]
- maxWidth = 0
- lines.each do |i|
- t = i.length
- maxWidth = t if t > maxWidth
- end
- maxWidth += 1 if maxWidth.odd?
- maxWidth += 2 # padding
- puts ''
- lines.each do |i|
- puts i.center(maxWidth)
- end
- puts ''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement