$50 if you get this code to work

Discussion in 'Mac Help/Tips' started by springscansing, Apr 15, 2003.

  1. springscansing macrumors 6502a

    springscansing

    Joined:
    Oct 13, 2002
    Location:
    New York
    #1
    Hello there. I have a need to predict the next number in a series of numbers generated via a LCG (linear congruency generator), which is a sort of random number generator.

    There's C code to do this here, so you don't need to know how it actually works (I think):
    http://www.uni-mainz.de/~pommeren/Kryptologie/Material/lcgcrack.c

    And to get that working, you'll need GMP, which is a large number computation package:
    http://www.swox.com/gmp/

    If someone can make this magic into an application, I'll give them $50 bucks (paypal, money order, whatever).

    Now I know nothing about C, and the only programming I do is in Max and Supercollider (smalltalk). I have no idea how hard that would be to get running as an application, and if it's worth the time to do it considering the measly reward I am offering. If you are a 15 year old whiz kid though who could help me out though, and could use the money, that would be fantastic.

    Let me know, m'kay? springscansing@mac.com
     
  2. springscansing thread starter macrumors 6502a

    springscansing

    Joined:
    Oct 13, 2002
    Location:
    New York
  3. dethl macrumors regular

    Joined:
    Aug 28, 2002
    Location:
    Austin, TX
    #3
    Although I'm probably giving up the cash...if you have Mac OS X with the deveopler tools loaded, a simple "gcc" command from the terminal will turn your source code into a fully functional command-line application, afterwards, just ./<outputfile> and it will execute.

    Now if you want a GUI, thats another story...I haven't even begun that path yet :p

    EDIT: syntax for gcc

    gcc <sourcefile>.c

    There should be a visable output file of some sort (forgot the default name :p)...anyway, that is your program.
     
  4. pepeleuepe macrumors 6502

    Joined:
    Oct 27, 2002
    Location:
    Los Angeles, California
    #4
    the default gcc output filename is "a.out" If you want to rename the output file simply type the command like this:

    gcc -o program_name source.c

    with "source.c" being the source code and "program_name" being the desired program name.
     
  5. logicat2001 macrumors regular

    Joined:
    Apr 16, 2003
    Location:
    Minneapolis, MN
    #5
    I've compiled your code.

    It's done.

    I sent you a brief email. Please reply and let me know what to do next. I'd like you to test whether or not it works as expected (I have no zuftab file to test it myself).

    Best,
    Logicat

    Re: the above posters- you are correct but your commands didn't account for linking in the gmp library.
     
  6. dethl macrumors regular

    Joined:
    Aug 28, 2002
    Location:
    Austin, TX
    #6
    <i>Re: the above posters- you are correct but your commands didn't account for linking in the gmp library.</i>

    I realized this soon before I fell asleep :p

    I could have done this, but I didn't have the developer tools installed, and downloading the .dmg again would take forever since I am on a 56k dialup connection.
     
  7. iloveMac macrumors newbie

    Joined:
    Jan 6, 2002
    #7
    I sent you an email on the new program that works. The many mistakes you made could have been easily seen simply by making your code more readable.

    Try reading books on programming styles and you will see a huge difference in your program.
     
  8. springscansing thread starter macrumors 6502a

    springscansing

    Joined:
    Oct 13, 2002
    Location:
    New York
    #8
    That's for the great advice. I'll notify the person who wrote it.
     

Share This Page