home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1993 August / 1993-08.d64 / chess.fb (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  608b  |  28 lines

  1. 10 poke53280,6:poke53281,6:print"[147]"
  2. 20 input"number of games played";g
  3. 30 deffnf(x)=(99^(x/800))/(1+(99^(x/800))):rem  rating formula
  4. 40 input"your rating";r
  5. 50 print"opponents' ratings?"
  6. 60 forb=1tog
  7. 70 input o:if o<1 then restore:end
  8. 80 x=r-o
  9. 90 if x<-800 then x=-800
  10. 100 d=d+fnf(x)
  11. 110 next
  12. 120 input"your score";s:s=s-d
  13. 130 if r<2100 then 170
  14. 140 if r<2400 then 160
  15. 150 s=s*16:goto 220
  16. 160 s=s*24:goto 220
  17. 170 s=s*32:if r+s+.5>int(2099) then 220
  18. 180 if g<4 then g=4
  19. 190 if s>32+(3*(g-4))and r+s+s-(32+(3*(g-4)))<2100 then 210
  20. 200 goto220
  21. 210 r=r+s+s-(32+(3*(g-4))):goto230
  22. 220 r=r+s
  23. 230 print:print"your new rating is";int(r+.5)
  24. 240 print:print"again?"
  25. 250 get a$: if a$=""then 250
  26. 260 if a$<>"y" then end
  27. 270 goto10
  28.