Re: Huge arrays - around 46233 elements
> I wrote a simple tick-tack-toe program which would go through all the
> possible moves it could make and decide which would make it more likely
> that the other player would not win. I need every possible combanation of
> 1, 2, 3, 4, 5, 6, 7, and 8 elements. So, origonally I calculated it while
> the program was running, but that took way too long and about 98% of the
> calculations weren't used. So I calculated all the info in advance and
then
> put it into a constant in the program. When I run the program, it says
"sub
> program too large" or something like that. It didn't even get to the code
> yet! Anyway, the whole program eas about 49,000 lines. Is this because I
am
> using the Public Domain Edition or does Euphoria not support such large
> arrays (about 46233)? Could I store this info in a file and then read it
> when the program loads?
> JJProg the Techie
Euphoria can support any size of array, pending memory of course. The wall
you appear to be hitting is the actual number of source code lines...it's
not a limitation in the Public Domain version, as I am a registered owner
and hit that message too when I was converting my bitmaps into Euphoria
source code. The best thing you can do is either break the constant
assignment down into several stages (instead of one mega-long assignment
statement, create your array using two or more assignment statements that
are smaller in length) or load from a file outside your program.
Hope this helps
David Gay
|
Not Categorized, Please Help
|
|