Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!howland.reston.ans.net!Germany.EU.net!Munich.Germany.EU.net!ecrc!news
From: micha@ecrc.de (Micha Meier)
Subject: Re: accessing individual elements of a lis
Message-ID: <D57vFM.A56@ecrc.de>
Sender: news@ecrc.de
Reply-To: micha@ecrc.de
Organization: European Computer-Industry Research Centre
References: <D56FJ2.LDx@IRO.UMontreal.CA>
Date: Fri, 10 Mar 1995 08:54:57 GMT
Lines: 22

In article LDx@IRO.UMontreal.CA, tarau@IRO.UMontreal.CA (Paul Tarau) writes:
> In article <3jjc8j$h8p@gboro.rowan.edu> diamond@elvis.rowan.edu (Sean J. Diamond) writes:
> >I'm writing a program to play a game and I have most of it done except I
> >can't figure out how to check the value of the nth element of a list.
> 
> Well, as usually game writing is too serious to be homework :-), here it is:

I would say that if anyone is able to write a game in Prolog, he should certainly
be able to access the n-th element of a list :-) For real work, it is of course
much better to use structures than lists, because the access is in constant
time.

--Micha


---
Micha Meier			------------------------------------------------
ECRC, Arabellastr. 17		The opinions expressed above are private
D-81925 Munich 81		and may not reflect those of my employer.
micha@ecrc.de, Tel. +49-89-92699-108, Fax  +49-89-92699-170


