Friday, January 30, 2009

3N+1 and More

I spent a couple of hours working on the 3N+1 problem last night, most of which was actually used to setup SVN, cppunit, and a few other things on my PC. Instead of looking up some of the old code I've submitted in the past for 3N+1, I wanted to program it from memory...at least the basic solution anyway (think I still have a copy of an old solution that is optimized which I might look at). It seemed to work pretty well, but apparently I have a small bug somewhere since UVA is rejecting it (the lovely "wrong answer" reply). I ran about 50 tests (some of my own, but most from previous courses on Blackboard), and all of them passed. I'm probably missing some basic test case, although I'm not sure what. I did test a few obvious ones (i may not be less than j, input of something like "1 1", etc.). I didn't really dwell on the problem too much. I'll probably look at it again later tonight or tomorrow (along with my old solution) and figure out what dumb mistake I made...as well as how I made/picked such bad tests. I also have to work with getting Doxygen to work.

As for the other parts of the course, it is early, but I am enjoying things so far. Some of the stuff has been a bit of a review (left/right hand values, exceptions, assertions, etc.) since I've had Downing twice before. Then again, I seem to have problems remembering things like efficient ways of generating prime numbers, so I guess a little extra review here and there will help me remember these things better. As the course continues, I imagine we'll get more into the specifics of C++ and OOP. While I did take a 1 hour C++ course a year ago, I'm still relatively new to the language, so another ~15 weeks or so of programming in the language should help me out a lot (especially since I've rarely used it in the last 6 months or so).

I guess that's about it for now. I have a lot of work I need to get done over the next few days, so I better get started.


Update: Yep. Of course it was a stupid mistake on my part regarding how I did the output for the answer (specifically, 'i' and 'j'). Guess that also explains why my Unit Tests weren't picking up anything (they were just testing the answer, 'v'). Good times. Now time to do some documentation...and possibly optimize it some, although I think I may just stick with what I have.

Thursday, January 22, 2009

Test

Testing the new blog for CS371p.