Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

search variable

search variable

search variable

sorry for my English

this is my code
stampa_diagnosi(X) :- gia_chiesto(S, 'si'), sintomo(S, M), not(sintomo(S, X)), M \= X,
nl, write('Una possibile diagnosi è: '), write(X), nl,
write('il paziente ha un peso minore di 65 KG? (1, 2, 3) '),nl,read(X),peso(P), nl.
peso(1) :- write('Possibile cura: '), cura1(X), nl, write(' ----- '), nl,spiegacome.
peso(2) :- write('Possibile cura: '), cura2(X), nl, write(' ----- '), nl,spiegacome.
peso(3) :- write('Possibile cura: '), cura3(X), nl, write(' ----- '), nl,spiegacome.

cura1(centaurea_minore) :- write('La cura è di 10 gocce .').

cura2(centaurea_minore) :- write('La cura è di 30 gocce .').

cura3(centaurea_minore) :- write('La cura è di 40 gocce .').

cura1(agnocasto) :- write('La cura è di 10 gocce .').

cura2(agnocasto) :- write('La cura è di 30 gocce .').

cura3(agnocasto) :- write('La cura è di 40 gocce .').

how do I maintain the value of X of diagnosis that is lost when I ask the question of the weight of the patient?

My question requires me once I found the cure based on the weight I have to select the right one as I do??

Obviously I have a lot of care and care for each three solutions

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close