[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: computer-go: Languages for programming go are?
Christian Nentwich <c.nentwich@xxxxxxxxxxxxxxxxx> wrote:
>> a string is encoded into a board-size bitmap, then all you need to do is to
>> "shake" it once to each direction (constant time), and AND it with the
> Shake it once to each direction is linear time in the size of the string
> if you do it properly. Otherwise, you have to copy the whole board over,
> which is constant time, but no string will ever be as long as 361 stones
> for this to pay off..
> Or did I get this wrong ?
Last time I implemented this, I used 21 words of 32 bits (to have a little
edge around the board). Shaking left and right was just a single shift and
or, no savings there. Shaking up and down I could have checked for empty
rows, but didn't find any performance savings. Maybe I could have, if I had
passed the starting row, so I would have known when to stop looping, but I
did not try that. No idea what passing that extra parameter would cost.
Minimal, in any case.
- Heikki
--
Heikki Levanto LSD Levanto Software Development heikki@xxxxxxxxxxxxxxxxx
"In Murphy we Turst"