Previous Entry Share Next Entry
06:58 pm, 5 Jun 03

i ought to be more careful

I got a really bad grade on my compilers assignment, and I was sorta disappointed because I really should’ve put more time into it. I was proud when I turned it in because I was pretty confident it mostly worked, but when I got it back I saw that it didn’t.

Just now I looked at it more carefully, wondering what I had wrong. Was it the harder stuff, like arrays of arrays or pass by reference? No, somehow I failed simple things like the “if-then-else” test! I investigated further and discovered that I had inverted the meanings of the literals “true” and “false” (apparently my test to verify they worked was something like if true or false, which has the same meaning when they’re inverted).

Many of their tests relied on those working. Stuff like the test of break (while (true) { okflag = 1; break; }) was not producing the expected result for reasons other than my (correctly working) break implementation.

And the arrays? They worked fine. 20% of my grade was lost due to the simple inversion of two very important characters.