Current Forum: Homework 5 - Parts 1 and 2 |
Date: Sat Nov 10 2001 11:26 am |
Author: Abeles, Peter J. <pja@andrew.cmu.edu> |
Subject: Re: 10 lines?? I only needed 3 - That must be some ugly code |
|
|
I'm assuming you mean you dont count the if statements. Because if you use something else besides an if (switch, blah = foo < bar ? 1 : 2;) it still adds lines. I also dont see anyway to hide a decision point inside another function. But striping away all of my if/for/try/catch statements my code would be 4 lines. 1 toggel switch and 3 Vector.add . If I am wrong and you figured out a way to do it in 3 lines including any for/if/switch/try/catch statements I would be very interested in seeing your code :)
- Peter |
|