[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [computer-go] Chains and liberties
> -----Original Message-----
> From: computer-go-bounces@xxxxxxxxxxxxxxxxx
> [mailto:computer-go-bounces@xxxxxxxxxxxxxxxxx]On Behalf Of Peter Drake
> Sent: Saturday, November 13, 2004 17:57
> To: computer-go
> Subject: Re: [computer-go] Chains and liberties
>
> >
> > Keeping a change stack that can be unwinded to perform undo is way
> > easier. It has been described here before how GNU Go does that, but
> > since it relies heavily on pointers to arbitrary board data it's maybe
> > not feasible in Java.
>
> I don't think this would be a problem in Java. Java has pointers, you
> just can't do arithmetic on them -- and you don't have to worry about
> dangling pointers, memory leaks, etc.
>
I think Gunnar is right about this. Java doesn't have real pointers, it has
references.
My guess is he keeps a stack of pointer-value pairs. Upon undo he just
writes the value at the address of the pointer, which could be in the middle
of some array or a data-structure. In Java you can't do that.
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/