Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

[1004] Arrays Again =(

2 replies · 675 views · Started 05 May 2009

Input:

int a[5] = "1,2,3,4,5";
ffc script c{
void run(){
for(int i;i<5;i++) Trace(a[i]);
int b[5] = "5,4,3,2,1";
for(int i;i<5;i++) Trace(b[i]);
}
}

Output:

49.0000
44.0000
50.0000
44.0000
53.0000
53.0000
44.0000
52.0000
44.0000
49.0000

Your array is a string. Each character in the string is stored by its ASCII value. For instance, "1" is ASCII value 49. "," is ASCII value 44.

Change the arrays to this form:
int a[5] = {1,2,3,4,5};
and see if that helps.

Oops...

I shouldn't be doing that really, I was reading some problems someone at PZC was having and not thinking.