The codeprint script produces a pdef file of one or more code/text files in a nice compact form suitable for printing without killing a whole forest in the process. When you have to turn in printed code in this class, please use codeprint to produce a pdf, then printout the pdf.

Installing codeprint in WSL

To install codeprint, copy and paste the entire line below (carefull, it's long!) into you Linux terminal and hit enter:
curl -Lf https://www.usna.edu/Users/cs/wcbrown/courses/S22SI204/resources/codeprint > ~/bin/codeprint && chmod +700 ~/bin/codeprint    
  
If you are successful, then if you give the command codeprint all by itself, you should see a usage message rather than a "command not found" error.

Printing your HW source code hw.cpp

Suppose you need to print three files: foo.cpp, help.h and help.cpp. With codeprint, you would cd to the directory in which these files lived and give the command:
codeprint foo.cpp help.h help.cpp
This would produce the file out.pdf in that directory, which you would print from Windows. You have two choices as to how to print this.
  1. You could move out.pdf to your Downloads directory with
    mv out.pdf ~/Downloads
    and use the usual Windows file browser to find out.pdf in Downloads, and print it out.
  2. You could use the Windows file browser and find out.pdf in the directory you created it in by navigating from the si204 folder on your Desktop, and print it out.