home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1985 October
/
Ahoy_Magazine_85-10_1985_Double_L.d64
/
cd22-2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
668b
|
19 lines
0 rem << cd22-2 >>
1 rem
2 rem solution to problem #18-2 :
3 rem billiard balls
4 rem by russell wilson
5 rem
110 dimc$(12,2),s$(3):x$="":w$(1)="heavy ":w$(2)="light "
120 fori=1to12:forj=1to2:readc$(i,j):nextj,i:fori=1to3:reads$(i):nexti
130 data bbr,bbl,lbl,rbr,lrb,rlb,llb,rrb,rbl,lbr,lll,rrr,rlr,lrl,rrl,llr
135 data brr,bll,blr,brl,rbb,lbb,brb,blb
140 data 2 3 4 6 + 5 7 8 11,4 6 7 10 + 3 8 9 12,2 5 6 8 + 1 7 9 10
150 printchr$(147);"remember ball# (1-12) and if it is heavy or light.":print
160 print"enter l=left heavy":printtab(6);"b=balanced"
165 printtab(6);"r=right heavy":print
170 fori=1to3:prints$(i):printtab(7);:inputr$:x$=x$+r$:print:nexti
180 fori=1to12:forj=1to2:ifx$=c$(i,j)then200
190 nextj,i
200 printchr$(18);i;chr$(157);" ball is ";w$(j)