in reply to Code fails without any reason?
I have no idea. Try reducing the amount of pre-initialization you do.{ print "$i $c_IN $in_i\n"; # <----- $x[$i] = $actafer[$in_i][$i];
Of course, that might require that you re-examine the algorithm and attempt to write it in Perl, not C-Perl. You're not taking advantage of Perl's capabilities, so it's going to waste (more) memory.
However, unless you're working with a small box, you shouldn't run out of memory without some loops and push or unshift or splice to make your arrays big. *shrugs*
In case you're wondering why this answer isn't that helpful ... I'm not going to parse and learn your code without you paying me. I'll help you after you explain what's going on. "Help!" doesn't cut it.
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Code fails without any reason?
by Bluepixel (Beadle) on May 01, 2003 at 14:57 UTC | |
by dragonchild (Archbishop) on May 01, 2003 at 15:15 UTC |