Most of the code for this lab is provided for you in the lab8 directory. Use the following command to create a lab8 subdirectory off your current directory:
cp -r /usr/users/mdanfor/public_html/cs223-s08/lab8/ .The
-r
option to cp
is what will create the lab8
subdirectory and copy all the files over to it.
make file_gen
which will
make an executable called file_gen
vtprintf(COLOR)
where
COLOR is one of the colors defined in the file.
make main
. This will create an
executable called main
, which can be run with
main input1
or any other filename.
make
commands to work.
rxvt -rv -ls -sl 1000The
-rv
option will do reverse video which will swap the
background and foreground colors. So if your normal terminal in 407 has a
white background with black text, -rv
will launch rxvt with
a black background and white text. The -ls
option will source
your .profile file on Helios, which is what sets up the blue and green prompt
that tells you what directory you are in currently. The -sl 1000
option will set the scrollback buffer to 1000 lines.
If you are using your laptop instead of the machines in 407, make sure that your terminal supports VT100 ANSI colors. Putty for Windows should work, as should the Mac OS X terminal. The pausing code may behave oddly if you try to download it and compile it on Windows (even though there is a workaround in the code, Windows does poorly with this sort of task), so make sure to log into Helios and try the code there.
Turn off debugging mode by removing, commenting out or undefining the
DEBUG_MODE line and recompile the program with make main
. Try
running the following:
time main input1This will show you how long it takes to run the quicksort executable for input1. You can try this for all the files you've generated for this lab. However, Helios is pretty fast, so you may not notice much of a time difference with the defined MAX_CAPACITY.
Email me your modified lab8main.cpp.