R. Clayton (rclayton@monmouth.edu)
(no date)
This is just reminder that each procedure you write should not contain more
than 30 code semicolons (a code semicolon is any semicolon that appears in the
body of a procedure definition, but not within a comment, string literal, or
character literal).
A procedure having n > 30 semicolons costs you ceiling((n - 30)/5) points. For
your programming convenience, you can use the count-sc command to measure your
code. count-sc can be found in /export/home/class/util/bin on any cslab or
linux machine. The command-line format is
count-sc [ -ln ] c-source-file
The -l option lets you set the per-procedure semicolon maximum to n.
count-sc has been wired into the turn-in script. If your code compiles
successfully, the source files will be run through count-sc. Nothing is output
if there's no problems, othewise you'll see output that looks like this:
$ count-sc
in file assignment2a.cc:
procedure main has 81 semicolons, 51 over the limit of 30.
$
(As an aside, this example overage costs ceiling((81 - 30)/5) = ceiling(51/5) =
ceiling(10.2) = 11 points.)
Let me know if you have any questions.
This archive was generated by hypermail 2.0b3 on Mon Dec 15 2003 - 19:45:06 EST