HomeForumsWhat's newResources 
 
 
Programming Advice for HUGE Numbers
slinga - Dec 29, 2004
 slinga Dec 29, 2004
Hey guys,

I'm a pretty crappy programmer, but I got a crazy side project I want to do some work on. (I'm also bad at math, so I have no way of realizing how feasible this is.)

What I'm trying to do is loop through every possible 64 character string imaginable, where the legal characters are 0-9,A,B,C. So I'm guessing on the order of ~13^64 possible strings.

Something like:

0000....................000

0000....................001

0000....................002

...

...

...

CCC....................CCA

CCC....................CCB

CCC....................CCC

And the string has to be an array, because I need to search each component individually. For example I have to be able to determine if the array contains a B or a 9, and the only way I know how to do that is to have a nested for loop search each index of the array until I find that value.

So anyway I'm rambling on, one problem at a time, how do I store a value of 13^64 in C? Do I even have enough ram (yep I'm REALLY terrible at math). Thanks in advance.

 antime Dec 30, 2004
You would get better suggestions if you actually stated the problem you're trying to solve, but to loop through all strings just treat the letters as the digits of a number and count up.

 slinga Dec 30, 2004
Estimating the number of legal chess positions (not possible games) on a standard chess board. Shit man stop laughing, I told you it was crazy.

Anyway my super huge over-estimate is 13^64. These aren't LEGAL chess positions, just possible positions. So I'm trying to reduce the estimate to something far manageable.

 antime Dec 30, 2004
I wouldn't try to brute-force the solution unless you have a lot of time. The number of legal positions is estimated to be at least 10^43....

 M3d10n Dec 31, 2004
Not quite the answer for your question, but maybe this... can help?

 it290 Dec 31, 2004
Sorry, sort of off-topic, but that article was pretty interesting. I was actually just having a conversation about computer chess before reading this. After reading through some of the articles, I was wondering- does anyone know of a 'non-searching' (bad terminology) chess program? That is, one which tries to use a more human playing style, and not just brute force? I think that would make for an interesting game.