Pristine Ack-5.5
[Ack-5.5.git] / lang / basic / test / bull.b
1 10 rem *** bullseye
2 20 print "game of bullseye":print:randomize
3 30 print "in this game, up to 20 players throw darts at a target"
4 40 print "with 10,20,30, and 40 point zones. The objective is"
5 50 print "toget 200 point.":print
6 60 print "throw","description",,"probable score"
7 70 print " 1","fast overarm",,"bullseye or complete miss"
8 80 print " 2","controlled overarm","10,20,30 points"
9 90 print " 3","underarm",,"anything":print
10 100 dim a$(20),s(20),w(10):r=0:m=0: for i=1 to 20:s(i)=0:nexti
11 110 input ;"how many players";n:print
12 120 for i=1 to n
13 130 print "name of player" i; : input a$(i)
14 140 nexti
15 150 r=r+1:print:print "round" r
16 160 for i=1 to n
17 170 print:print a$(i)"'s throw";:input t
18 180if t<1 or t>3 then print "input 1, 2, or 3":goto 170
19 190 on t goto 200,210,220
20 200 p1=.65:p2=.55:p3=.5:p4=.5:goto 230
21 210p1=.99:p2=.77:p3=.43:p4=.01:goto 230
22 220 p1=.95:p2=.75:p3=.45:p4=.05
23 230 u=rnd(0):print "rnd="u
24 240 if u>=p1 then print "BULLSEYE!! 40 points":b=40:goto 290
25 250 if u>=p2 then print "30-point zone":b=30:goto 290
26 260 if u>=p3 then print "20-point zone":b=20:goto 290
27 270 if u>=p4 then print "WHEH! 10 points":b=10:goto 290
28 280 print "missed the target. too bad!":b=0
29 290 s(i)=s(i)+b:print "total score="s(i):next i
30 300 fori=1 to n
31 310 if s(i)>=200 then m=m+1:w(m)=i
32 320 nexti
33 330 if m=0 then150
34 340 print :print "We have a winner!!":print
35 350 print a$(w(m))" scored"s(w(m))"points."
36 360 for i=1 to m 
37 370 print:print "thanks for the game!":nexti:end