Calendar: Difference between revisions
Content deleted Content added
→{{header|Ruby}}: Need 1.8.7 |
→{{header|Ruby}}: Try to require 'io/console' to guess the terminal's width. |
||
Line 964:
ARGV.length == 1 or
# Guess width of terminal
# 1. Obey environment variable COLUMNS.
# 2. Try to
# 3.
# 4. Assume 80 columns.
columns =
begin require 'io/console'; IO.console.winsize[1]
rescue LoadError
begin Integer(`tput co`)
rescue
80; end; end; end
puts cal(Integer(ARGV[0]), columns)</lang>
|