Thread: Me and my 2.8+ million lines of code

  1. #1
    1.b4 e5 2.a3 d5 3.d4 exd
    Join Date
    Jan 2003
    Posts
    167

    Me and my 2.8+ million lines of code

    I wrote a 2700 line program to generate 2.8 million lines of if/and statements, which it now happily spams into my command prompt, via cout<<. The problem is that my command prompt apparently doesn't remember all 2.8 million lines (I think the buffer max is like 999 lines), is there a way I can output my newly generated code somewhere that I can read it, and then cut and paste it into my compiler -- Notepad perhaps?
    Last edited by Noobie; 05-09-2003 at 04:10 AM.
    AIM: MarderIII

  2. #2
    i want wookie cookies the Wookie's Avatar
    Join Date
    Oct 2002
    Posts
    455
    write it out to a a file

  3. #3
    Grammar Police HybridM's Avatar
    Join Date
    Jan 2003
    Posts
    355
    I'm no expert but...

    won't that take an awful long time to compile?
    Thor's self help tip:
    Maybe a neighbor is tossing leaf clippings on your lawn, looking at your woman, or harboring desires regarding your longboat. You enslave his children, set his house on fire. He shall not bother you again.

    OS: Windows XP
    Compiler: MSVC

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Salem really sums it up...

    >>> Sounds like you need a better approach

    ... what on Earth are you trying to do?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    2.8 million lines? Why? What are you trying to do?
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  6. #6
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Hm, 2.8 million if's? Ouch. Wouldn't it be better to find some way to use a loop or something? Or maybe a better test condition or something?

    Also, I don't think Notepad can handle 2.8-million line files. It choked on a 2Kb file or something for me, and 2.8 million lines is going to be something like 28Mb...
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  7. #7
    Registered User Xei's Avatar
    Join Date
    May 2002
    Posts
    719
    You're a freak.
    "What are you after - the vague post of the week award?" - Salem
    IPv6 Ready.
    Travel the world, meet interesting people...kill them.
    Trying to fix or change something, only guaruntees and perpetuates its existence.
    I don't know about angels, but it is fear that gives men wings.
    The problem with wanting something is the fear of losing it, or never having it. The thought makes you weak.

    E-Mail Xei

  8. #8
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    Hunter2:

    2KB choked it??????

    If you right-click on a file you will see view(lister).

    That works in notepad. Bigger files will be put in wordpad.

    I did it with a 600 MB file.. so HA! you need a new hardrive.... try the Alien 4
    This war, like the next war, is a war to end war.

  9. #9
    Registered User devil@work's Avatar
    Join Date
    Mar 2003
    Posts
    33
    if you are under linux console try this ./executablename >dumpfile and you will have all the output send to dumpfile

  10. #10
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Originally posted by devil@work
    if you are under linux console try this ./executablename >dumpfile and you will have all the output send to dumpfile
    You can do that under Windows as well, as Salem suggested.

  11. #11
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    >it choked on 2kb??
    Oops, memory lapse. It choked on 100k actually, but the end result is still the same, notepad won't handle a 28Mb file. And yes, I know that Wordpad will handle large file sizes; no need to boast about your harddrive handling a 600mb textfile or whatever it was, I've had wordpad handle a 30.2Gb textfile. So... I'll just keep my cheap no-name brand econosaver harddrive that I got for a few pennies
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  12. #12
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    I don't know what you're doing, but have you at least considered a Switch...case statement, if you can't think of any other ways to do it? Because 2.8 million lines of nothing but if statements is ridiculous.
    Away.

  13. #13
    1.b4 e5 2.a3 d5 3.d4 exd
    Join Date
    Jan 2003
    Posts
    167
    lol yah uh, gimme a url to a good tutorial on switch ive never used it before
    AIM: MarderIII

  14. #14
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Try this. Things aren't always that hard to find; and cprogramming.com has a lot of good tutorials for the basics.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  15. #15
    1.b4 e5 2.a3 d5 3.d4 exd
    Join Date
    Jan 2003
    Posts
    167
    Code:
    cin>>input;	 
    
      switch (input)	
    
      {	   
    
       case 1: playgame();
    
    	   break;
    if input is:

    char input[256]

    and case 1=playgame

    then how would the above be rewritten?
    AIM: MarderIII

Popular pages Recent additions subscribe to a feed