This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A more sophisticated demonstration of change-type


On Sun, 2004-06-06 at 20:26, Lincoln Peters wrote:
> On Sat, 2004-05-29 at 10:14, Eric McDonald wrote:
> > It turns out that the 'acp-to-attack' problem you were seeing is related
> > to this. The 'atk1', 'atk2', etc. are also lists of lists; i.e., 'atk1'
> > expands to:
> >   ((knight-1) (knight-2) ... (knight-6))
> > instead of:
> >   (knight-1 knight-2 ... knight-6)
> > Placing an 'append' in the definition solves the problem:
> >   (define atk1 (append l1 l2 l3 l4 l5 l6))
> 
> That did seem to work initially, but I've been elaborating on the game,
> and seem to have run into an even more complex problem.  Consider the
> following (admittedly *really* long) snippet of code from the new
> version:

[ snipped ]

> (define blue-dragons (append blue-wyrmling very-young-blue-dragon young-blue-dragon juvenile-blue-dragon young-adult-blue-dragon adult-blue-dragon mature-adult-blue-dragon old-blue-dragon very-old-blue-dragon ancient-blue-dragon blue-wyrm great-blue-wyrm))

The use of 'append' is not necessary here. You can simply define
'blue-dragons' as a list of atoms. 'append' is used to flatten a list of
lists (and possibly atoms as well) into a single list of atoms.

Likewise for the other wyrmish hues.

[ snipped ]

> (define true-dragons (append blue-dragons))
> (define true-dragons (append copper-dragons))
> (define true-dragons (append gold-dragons))
> (define true-dragons (append red-dragons))

You are trying to override your definition of 'true-dragons' 3 times.
Try this instead:
(define true-dragons (append blue-dragons copper-dragons gold-dragons
red-dragons))
That should give you the desired effect.

> (define dragons (append true-dragons))
> (define dragons (append dragon-turtle wyvern))

(define dragons (append true-dragons dragon-turtle wyvern))

should be sufficient.

> So what the heck am I doing wrong here?  

Try my suggestions above; I think they should do what you want.

> Wait until you see the rest of this new version!

Very much looking forward to it. Looks like it exceeds Bellum II in
numbers of units now. Lots of monsters to slaughter, it seems; can't
wait for the carnage to begin. Let me know when I can have a "developer
release". :-)

Eric


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]