swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] C arrays and swarm: strange behaviour (long)


From: Marcus G. Daniels
Subject: Re: [Swarm-Support] C arrays and swarm: strange behaviour (long)
Date: Tue, 18 Mar 2008 20:21:52 -0600
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

paul box wrote:
-shiftLists {
  Player * playboy;
  double avePay[TOTAL]; //
  double proportion[TOTAL];
  double trigger[TOTAL];
  int i, j;

The average pay of each strategy is calculated for each list:

    for (i=SOCIAL; i<=TOTAL; i++) avePay[i] = 0.0;
One bug is that you can't loop up to and including TOTAL unless you extend the arrays by one, e.g. "double avePay[TOTAL+1]. Otherwise <= instead of < will run off the end of the array.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]