[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: computer-go: Sharing Go modules
> Its also just as easy to say
>
> othercolor = INVERT[color];
>
> And have it arbitrarily defined (within reason, don't define black as 1000
> and white as 2000 for this method).
>
>
> If BLACK is 0 and WHITE is 1 is easy to write code like
>
> procedure DoSomething(p: boardoffset; color: boardcolor);
> begin
> othercolor := 1-color;
> ...
> end;
And if BLACK is 1 and WHITE is 2, then
othercolor = color ^ (BLACK | WHITE);
-+- Sid Maxwell