Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Domains
- A,B,C,D,E,F,G,H=integer.
- predicates
- start.
- sum.
- score(A,B,C,D,E,F,G,H).
- clauses
- score(A,B,C,D,E,F,G,H):-
- S = A+B+C+D+E+F+G+H,
- write("Your depression level is ",S).
- start:-sum,nl.
- sum:-
- makewindow(1,2,3,"Depressiion test",0,0,25,80),
- write("Question 1-How often have you had little interest or pleasure in doing things?"),nl,
- write("Not at all- Type 0"),nl,
- write("Several days- Type 1"),nl,
- write("More than half the days- Type 2"),nl,
- write("Nearly Every Day- Type 3"),nl,
- readint(A),
- write("Question 2- How often have you been bothered by feeling down, depressed or hopeless?"),nl,
- write("Not at all- Type 0"),nl,
- write("Several days- Type 1"),nl,
- write("More than half the days- Type 2"),nl,
- write("Nearly Every Day- Type 3"),nl,
- readint(B),
- write("Question 3-How often have you been bothered by trouble falling or staying asleep, or sleeping too much?"),nl,
- write("Not at all- Type 0"),nl,
- write("Several days- Type 1"),nl,
- write("More than half the days- Type 2"),nl,
- write("Nearly Every Day- Type 3"),nl,
- readint(C),
- write("Question 4-How often have you been bothered by feeling tired or having little energy?"),nl,
- write("Not at all- Type 0"),nl,
- write("Several days- Type 1"),nl,
- write("More than half the days- Type 2"),nl,
- write("Nearly Every Day- Type 3"),nl,
- readint(D),
- write("Question 5-How often have you been bothered by poor appetite or overeating?"),nl,
- write("Not at all- Type 0"),nl,
- write("Several days- Type 1"),nl,
- write("More than half the days- Type 2"),nl,
- write("Nearly Every Day- Type 3"),nl,
- readint(E),
- write("Question 6-How often have you been bothered by feeling bad about yourself, or that you are a failure, or have let yourself or your family down?"),nl,
- readint(F),
- write("Not at all- Type 0"),nl,
- write("Several days- Type 1"),nl,
- write("More than half the days- Type 2"),nl,
- write("Nearly Every Day- Type 3"),nl,
- write("Question 7- How often have you been bothered by trouble concentrating on things, such as reading the newspaper or watching television?"),nl,
- write("Not at all- Type 0"),nl,
- write("Several days- Type 1"),nl,
- write("More than half the days- Type 2"),nl,
- write("Nearly Every Day- Type 3"),nl,
- readint(G),
- write("8-How often have you been bothered by moving or speaking so slowly that other people could have noticed, or the opposite - being so fidgety or restless that you have been moving around a lot more than usual?"),nl,
- write("Not at all- Type 0"),nl,
- write("Several days- Type 1"),nl,
- write("More than half the days- Type 2"),nl,
- write("Nearly Every Day- Type 3"),nl,
- readint(H),
- score(A,B,C,D,E,F,G,H).
- goal
- start.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement