🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #568

Re: general PROLOG questions

#568
From: Eric Iverson
Date: Mon, 11 Dec 1989 22:35
15 lines
1053 bytes
Hey, what's wrong with this as a solution?

nth0(Num,List,Item):-
    append(X,[Item|_],List),
    length(X,Num).

Of course the obvious answer is why bother, since it's in the library.
    
--
------------------------------------------------------------------------
Another Gruntpig production, in association with the Rat Lab Steamworks.

Bigamy is defined as having one wife too many.
Monogamy is defined the same way.
-Oscar Wilde
Technical Details
Message-ID: <EIVERSON.89Dec11153528@aigyptos.nmsu.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!cmcl2!lanl!opus!eiverson
References: <5631@uhccux.uhcc.hawaii.edu> <2898@munnari.oz.au> <793@fs1.ee.ubc.ca> <10231@alice.UUCP> <808@fs1.ee.ubc.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!cmcl2!lanl!opus!eiverson
From: eiverson@nmsu.edu (Eric Iverson)
Newsgroups: comp.lang.prolog
Subject: Re: general PROLOG questions
Message-ID: <EIVERSON.89Dec11153528@aigyptos.nmsu.edu>
Date: 11 Dec 89 22:35:28 GMT
References: <5631@uhccux.uhcc.hawaii.edu> <2898@munnari.oz.au> <793@fs1.ee.ubc.ca> <10231@alice.UUCP> <808@fs1.ee.ubc.ca>
Sender: news@nmsu.edu
Organization: NMSU Computer Science
Lines: 15
In-reply-to: vincel@fs0.ee.ubc.ca's message of 11 Dec 89 04:50:14 GMT