Article View: comp.lang.prolog
Article #1087Re: Having trouble with disjunction
From: #Stefan Bachert
Date: Wed, 15 Aug 1990 14:03
Date: Wed, 15 Aug 1990 14:03
20 lines
999 bytes
999 bytes
/ hpbbi4:comp.lang.prolog / F0O@psuvm.psu.edu / 3:17 pm Aug 14, 1990 /
Watch the precedence. I added brackets to show you what you
told your prolog.
gofirst(Player) :-
( random(RandNum),
RandNum < 0.5, Player = computer );
( RandNum >= 0.5, Player = opponent).
I think you intended the following
gofirst(Player) :-
random(RandNum),
(RandNum < 0.5, Player = computer ;
RandNum >= 0.5, Player = opponent).
Stefan
Technical Details
Message-ID:
<470016@hpbbi4.BBN.HP.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!sdd.hp.com!ucsd!ucbvax!hplabs!hpcc01!hpbbn!hpbbi4!stefanReferences:
<90226.091749F0O@psuvm.psu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!sdd.hp.com!ucsd!ucbvax!hplabs!hpcc01!hpbbn!hpbbi4!stefan From: stefan@hpbbi4.BBN.HP.COM (#Stefan Bachert) Newsgroups: comp.lang.prolog Subject: Re: Having trouble with disjunction Message-ID: <470016@hpbbi4.BBN.HP.COM> Date: 15 Aug 90 14:03:44 GMT References: <90226.091749F0O@psuvm.psu.edu> Organization: Hewlett-Packard GmbH Lines: 20