home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
microcrn
/
issue_30.arc
/
EXPERT2.PRO
< prev
Wrap
Text File
|
1979-12-31
|
896b
|
41 lines
challenger(Name, Country) :-
write('Who is the challenger?'),
nl,
read(Name),
asserta(challenger(Name, Country)).
incumbent(Name, Country) :-
write('Who is the incumbent?'),
nl,
read(Name),
asserta(incumbent(Name, Country)).
elections(Country) :-
economy(Country, Condition),
Condition = booming,
incumbent(Person, Country),
write('0.6 chance of win for '),
nl,
write(Person),
nl,
!.
elections(Country) :-
challenger(Person, Country),
write('challenger '),
write(Person),
nl,
write('likely to win'),
nl,
!.
economy(Country, Condition) :-
write('Is current state of economy boooming?(y or n)'),
nl,
read(y),
asserta( (economy(Country, booming) :- !) ).
economy(Country, Condition) :-
asserta( (economy(Country, shaky) :- ! ) ),
fail.