Dan said:
A: I am running the program from the DOS Command Prompt.
Are you using a GUI toolkit?
A: No, I don't even know what one is. I am new to both programming and
Ruby.
Are you just printing to the console?
A: Yes, I am just printing to the console.
When printing to the console, the simplest case is that you add spaces
or newlines.
10.times { puts }
puts (" " * 20) + "This is in the middle of the screen"
10.times { puts }
Being that most text mode programs print one line at a time, there isn't
an easier way. Perhaps you could write a method that printed 30 lines at
a time, if you wanted the illusion of being able to print to various
parts of the screen. A lot of people use simple ideas like printing
blank lines or loud characters to get the eye's attention. You can't
change the font, but there's a lot you can do to effectively
communicate. Some examples:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
!!!!!! Are you sure? !!!!!!!!!
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Started.........
To do more with screen positioning, there is a library called ncurses
that gives you complete flexibility to place anything anywhere on the
screen. This is really the standard for complex console output. The
homepage for ncurses-ruby is here:
http://ncurses-ruby.berlios.de/ , and
I saw what looked like a Windows package, but I don't know whether that
means you can install it without cygwin (Linux emulation, basically).
Learning to use this library might be too much to learn at once for a
beginner to programming, but know that this is the most powerful tool
(that can be used with Ruby) for doing layout stuff on the console.
If you will be content with being able to change colors, I would go for
a library called HighLine (
http://highline.rubyforge.org/). See the
examples here
http://viewvc.rubyforge.mmmultiworks.com/cgi/viewvc.cgi/trunk/highline/examples/?root=highline
for descriptions of how it can be used. You can find documentation from
the first link.
Good luck,
Dan