Re: How do you copy an array?
- From: Dan Bensen <randomgeek@xxxxxxxxxxxxxx>
- Date: Fri, 01 Sep 2006 17:08:59 -0500
Kim Minh Kaplan wrote:
> you don't need to copy your grid; just play and takeback
> the moves as you traverse the tree.
Geoffrey Summerhayes wrote:
checkers requires keeping the state of the
moved piece to 'unking' when necessary, go needs to restore captured
pieces, and chess has additional state information that isn't contained
in the board position that needs to be kept track of.
Thanks for the help. Just as I'm starting to learn functional programming, this grid seems to be a good counterexample in support of mutable state. I've been trying to avoid assignments as much as possible, but it looks like you can pay a heavy price for that in performance.
--
My name is dsb, and I'm at prairienet, which is an O-R-G.
.
- Follow-Ups:
- Re: How do you copy an array?
- From: Kim Minh Kaplan
- Re: How do you copy an array?
- References:
- Re: How do you copy an array?
- From: Geoffrey Summerhayes
- Re: How do you copy an array?
- Prev by Date: Re: Java is going to have closures.
- Next by Date: Re: Joel hammers the final nail into Lisp's coffin
- Previous by thread: Re: How do you copy an array?
- Next by thread: Re: How do you copy an array?
- Index(es):
Relevant Pages
|