Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!snorkelwacker!mit-eddie!uw-beaver!ubc-cs!fs1!fs0.ee.ubc.ca!vincel From: vincel@fs0.ee.ubc.ca (vincent li) Newsgroups: comp.lang.prolog Subject: Re: general PROLOG questions Keywords: new user.. Message-ID: <808@fs1.ee.ubc.ca> Date: 11 Dec 89 04:50:14 GMT References: <5631@uhccux.uhcc.hawaii.edu> <2898@munnari.oz.au> <793@fs1.ee.ubc.ca> <10231@alice.UUCP> Sender: news@fs1.ee.ubc.ca Reply-To: vincel@fs0.ee.ubc.ca (Vincent Li) Organization: Dept. of Electrical Engineering University of B.C. Lines: 21 In article <10231@alice.UUCP> pereira@alice.UUCP () writes: >Here's a cleaner version > >nth(1, [Elem|_], Elem). >nth(I, [_|Rest], Elem) :- > I > 0, > J is I - 1, > nth(J, Rest, Elem). > But then, like Mr. Naish says, what would Mr. Bush do if the code is perfect? I'm sure Mr. Bush is intelligent enough to question the validity of the given codes, discovers that it does not work, try to figure out what's going on, and may be learn a concept or two about Prolog programming, which is, I trust the purpose of the exercies, and not how to write the nth function in Prolog. But then, what am I to say, I could be wrong (about the purpose of the exercies or Mr. Bush's intelligence, or both)! We'll leave the purpose of assignments debate to comp.edu and Mr. Bush's intelligence to ... ? -------------------------------------------------- vincel@ee.ubc.ca |-) WORK is a four letter word. vinceli@triumfcl.bitnet |-(