[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: computer-go: Sharing Go modules
And just to add $.002, the subtraction version works just fine if one
subtract the current color from the sum of both colors, so no need for an
array..
(black + white) - black = white;
(black + white) - white = black;
(2000 + 1000) - 1000 = 2000
(2000 + 1000) - 2000 = 1000
(1 + 0) - 0 = 1
(1 + 0) - 1 = 0
(1 + 2) - 2 = 1
(1 + 2) - 1 = 2
...
Well, I guess I better stop now...
Lars Nilsson
----- Original Message -----
From: "Fant, Chris" <chris.fant@xxxxxxxxxxxxxxxxx>
To: <computer-go@xxxxxxxxxxxxxxxxx>
Sent: Wednesday, May 16, 2001 4:22 PM
Subject: 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;
>