Pristine Ack-5.5
[Ack-5.5.git] / lang / basic / test / learn.b
1 10 REM Learning program I
2 15 dim variable(10), rank(10), varname$(10)
3 20 input "how many variable have you";v
4 30 for i=1to v :variable(i)=0:rank(i)=0:next i
5 40 print "please name these variable"
6 50 for i=1to v: input "variable name";varname$(i):next i
7 60 print "Please name the outcomes"
8 70 input "outcome 1";q1$
9 80 input "outcome 2"; q2$
10 90 for i=1 to v:variable(i)=0
11 100 print "variable ";varname(i);
12 110 input "is this variable the case";a$
13 120 if a$="y" then variable(i)=1
14 130 next i
15 140 d=0
16 150 for i=1 to v
17 160 d=d+variable(i)* rank(i)
18 170 next i
19 175 print "conclusion: ";d;
20 180 if d>=0 then print q1$
21 190 if d<0 then print q2$
22 195 input "is this right";a$:if a$="y" then:goto 90
23 200 if d>=0 and a$="n" then: for i=1 to v:rank(i)=rank(i)-variable(i):next i
24 210 if d<0 and a$="n" then: for i=1 to v:rank(i)=rank(i)+variable(i):next i
25 220 goto 90