Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

Game Courier Developer's Guide. Learn how to design and program Chess variants for Game Courier.[All Comments] [Add Comment or Rating]
Thomas Marquardt wrote on Tue, Jan 27, 2009 01:37 PM UTC:
Hi, either I didn't get something, or I have found another bug.

I put the following code in the Pre-Game part:

set arr (x y);
sub test:
  local a2;
  set a2 ();
  for i var arr:  push a2 #i;  next;
  for i var a2:  echo #i;  next;
endsub;
gosub test;
gosub test;


I believe the output of this should be:

x
y
x
y

since test is called twice, and both times the content of arr is copied into a2 and then output. But the output is in fact:

x
y
x
y
x
y

In the second call of test, the old content of a2 is seemingly not deleted, and the 'x y' is appended to it.
If I make the variable a2 global (i.e. delete the line 'local a2;') then it works as it should.