Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

springscansing

macrumors 6502a
Original poster
Oct 13, 2002
922
0
New York
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
 
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.
 
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.
 
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.
 
<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.
 
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.
 
Originally posted by iloveMac
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.

That's for the great advice. I'll notify the person who wrote it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.