Computer Science Canada Anti-Loopist's Answer to 1+2+3... |
Author: | NewHydrolisk [ Fri Oct 26, 2007 7:19 pm ] |
Post subject: | Anti-Loopist's Answer to 1+2+3... |
My fourth project, and the only that works properly (so far). This is my first project submitted here though. It simply does a 1+2+3+4...+100 thing, but you can pick the numbers it starts and ends at. Perhaps it is faster than a loop. It's less than an MB, and the formula used is inside the program. I don't think bugs are possible... You need Windows (because I use Windows, but only because of the "system(Pause)" command at the end). Sorry other OS users! |
Author: | md [ Fri Oct 26, 2007 8:49 pm ] |
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... |
No source code? I would recommend no one run this unless source is provided, and even then I'd compile it myself. |
Author: | NewHydrolisk [ Fri Oct 26, 2007 9:50 pm ] |
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... |
Oops. Sorry. I'll post Alright, since this is my first time here (submitting), I wasn't very sure what to put. In the ZIP, there is a readme with the source code. By the way, it was written in C++. |
Author: | md [ Fri Oct 26, 2007 9:56 pm ] |
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... |
No problem, I'm just very anti-executables. Mostly since a) they are platform dependent and b) it's super easy to hide a virus in an executable. It's harder in source code. |
Author: | Tony [ Sat Oct 27, 2007 1:01 am ] |
Post subject: | Re: Anti-Loopist's Answer to 1+2+3... |
NewHydrolisk @ Fri Oct 26, 2007 7:19 pm wrote: You need Windows (because I use Windows, but only because of the "system(Pause)" command at the end). Sorry other OS users!
You don't really need system(Pause), do you? |
Author: | NewHydrolisk [ Sat Oct 27, 2007 7:18 pm ] |
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... |
Well, I used Visual Basic C++, and when I compiled it, the program exited immediately after you entered the first 2 numbers, which sort of drove me off the edge of sanity, and so I bashed it in because of my impatience. (Was trying to find an answer for 2 days...) |
Author: | rdrake [ Sat Oct 27, 2007 8:08 pm ] |
Post subject: | Re: RE:Anti-Loopist\'s Answer to 1+2+3... |
NewHydrolisk @ Sat Oct 27, 2007 7:18 pm wrote: Well, I used Visual Basic C++ Visual C++? |
Author: | Clayton [ Sat Oct 27, 2007 10:39 pm ] |
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... |
Whatever happened to just making an executable and executing from the command line? |
Author: | wtd [ Sat Oct 27, 2007 10:49 pm ] |
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... |
Not enough bling value. IDEs are the twenty inch chrome rims of the programming world. |
Author: | wtd [ Sat Oct 27, 2007 10:51 pm ] |
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... |
Note: I am still not seeing code. |
Author: | Tony [ Sat Oct 27, 2007 11:29 pm ] |
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... |
the chrome is rusty, the program still fires up cmd for the duration of its life. Where's DirectX with the flare effect?! |
Author: | NewHydrolisk [ Sun Oct 28, 2007 11:50 am ] | ||
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... | ||
Source Code Below:
Alright, that's the source. C++ |
Author: | Tony [ Sun Oct 28, 2007 1:48 pm ] | ||||
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... | ||||
It compiles and runs wonderfully on OS X, but it throws a warning when it gets to the Pause line -- you should really take that out. Quote: sh: line 1: PAUSE: command not found also - what's the reasoning behind
why not just
|
Author: | NewHydrolisk [ Sun Oct 28, 2007 7:46 pm ] | ||
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... | ||
I'm not sure myself why I had
Thanks for the... hint thing though. EDIT: I remember... I was following a tutorial, and so I had just put that there... Damn, I'm not too smart. |
Author: | michaelp [ Sun Feb 03, 2008 9:38 pm ] |
Post subject: | RE:Anti-Loopist\'s Answer to 1+2+3... |
If you use Code::Blocks as your IDE, it might automatically put a stop line in your code. Whenever I run it from the IDE, it stops and says how long it was up. |