home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1985 October / Ahoy_Magazine_85-10_1985_Double_L.d64 / cd22-2 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  668b  |  19 lines

  1. 0 rem << cd22-2 >>
  2. 1 rem
  3. 2 rem solution to problem #18-2 :
  4. 3 rem             billiard balls
  5. 4 rem by russell wilson
  6. 5 rem
  7. 110 dimc$(12,2),s$(3):x$="":w$(1)="heavy ":w$(2)="light "
  8. 120 fori=1to12:forj=1to2:readc$(i,j):nextj,i:fori=1to3:reads$(i):nexti
  9. 130 data bbr,bbl,lbl,rbr,lrb,rlb,llb,rrb,rbl,lbr,lll,rrr,rlr,lrl,rrl,llr
  10. 135 data brr,bll,blr,brl,rbb,lbb,brb,blb
  11. 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
  12. 150 printchr$(147);"remember ball# (1-12) and if it is heavy or light.":print
  13. 160 print"enter l=left heavy":printtab(6);"b=balanced"
  14. 165 printtab(6);"r=right heavy":print
  15. 170 fori=1to3:prints$(i):printtab(7);:inputr$:x$=x$+r$:print:nexti
  16. 180 fori=1to12:forj=1to2:ifx$=c$(i,j)then200
  17. 190 nextj,i
  18. 200 printchr$(18);i;chr$(157);" ball is ";w$(j)
  19.