home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0950.lha / BBDoors / BBDoors65.lha / rexxDoors / Yacht_C.rexx < prev    next >
OS/2 REXX Batch file  |  1993-08-07  |  32KB  |  1,254 lines

  1. /* Yacht-C.rexx version 1.1 by Matt English 8-4-93
  2.  
  3.    This game was written to work on Richard Stockton's
  4.    BBBBS program. You are welcome to use this on your
  5.    BBBBS system as long as my name is not removed from
  6.    this code, or the game screen.
  7.  
  8.    CONVERSIONS : !!!!!!!!
  9.    You are given permission to convert this game to ANY
  10.    other BBS system, Amiga or IBM, as long as:
  11.  
  12.    1. You leave my name in the code and on the game screen.
  13.    2. You have never written a game that says "ONLY TO BE
  14.       USED ON xxxxx BBS SYSTEM". ( I really, really hate that!)
  15.  
  16.    TO ALL SYSOPS:
  17.     If you use this game, a call to my BBS would be nice!
  18.     (If you've never called.) I have more ideas for the game,
  19.     and if I get enough interest there will be a "next version".
  20.  
  21.     The Alternative BBS (503) 761-3043
  22.  
  23.  
  24.     TO INSTALL ON BBBBS:
  25.      All ya have to do is copy the file "Yacht_C.rexx"
  26.      to your RexxDoors directory. The game will create
  27.      some data files after its played. Easy, Huh?
  28.  
  29.     Enjoy.
  30.  */
  31.  
  32. options results
  33. FF='0C'x  /* FormFeed */
  34. CR='0D'x  /* Carraige Return */
  35. CALL TIME('R')
  36. SIGNAL ON BREAK_C
  37. SIGNAL ON BREAK_E
  38.  
  39. bbspath=GETCLIP('BBS_path')
  40. bbspath=bbspath'rexxDoors/Data/'
  41. datapath = bbspath'Yacht_C'
  42.  
  43. /* Open the support library if it is not already open. */
  44. if ~show('L',"rexxsupport.library") then do
  45.     addlib('rexxsupport.library',0,-30,0)
  46.      end
  47.  
  48. wz = random(1,999,time('S')) /* initalize random number generator */
  49.  
  50. PARSE arg name winnings . colorflag secs .
  51. IF secs='' THEN secs=3600
  52. signal on syntax
  53. player = left(name,20)
  54.  
  55. address command'C:resident C:sort add'
  56.  
  57. def=''
  58. CLS = 'H'
  59. UNL = ''
  60.  
  61. call Prefs(1)
  62. IF ADDRESS()~='BAUD' THEN call Prefs(5)
  63.  
  64. player = pen.6||unl||player||def
  65.  
  66.  
  67. /* Positions */
  68.  pplayer='H';ps.1='8H';ps.2='8H';ps.3='8H';ps.4='8H';ps.5='8H'
  69.  ps.6='8H';psub='8H';pbon='28H';putot='28H';ps.3k='28H'
  70.  ps.4k='28H';ps.fh='28H';ps.ss='28H';ps.ls='28H'
  71.  ps.c='28H';ps.y='28H';pltot='28H';putot2='28H';ptot='28H'
  72.  
  73.  pln.1='H';pln.2='H';pln.3='H';pln.4='H';pln.5='H';pln.6='H';pln.3k='1H'
  74.  pln.4k='1H';pln.fh='1H';pln.ss='1H';pln.ls='1H'
  75.  pln.c='1H';pln.y='1H'
  76.  
  77.  phold.1='5H';phold.2='1H';phold.3='7H';phold.4='3H';phold.5='9H'
  78.  prollsleft='38H'
  79.  pprompt='34H'
  80.  pprompt1='34H'
  81.  pprompt2='34H'
  82.  
  83.  pd.1.1='5H';pd.1.2='6H';pd.1.3='7H';pd.1.4='5H';pd.1.5='6H';pd.1.6='7H';pd.1.7='5H';pd.1.8='6H';pd.1.9='7H'
  84.  pd.2.1='1H';pd.2.2='2H';pd.2.3='3H';pd.2.4='1H';pd.2.5='2H';pd.2.6='3H';pd.2.7='1H';pd.2.8='2H';pd.2.9='3H'
  85.  pd.3.1='7H';pd.3.2='8H';pd.3.3='9H';pd.3.4='7H';pd.3.5='8H';pd.3.6='9H';pd.3.7='7H';pd.3.8='8H';pd.3.9='9H'
  86.  pd.4.1='3H';pd.4.2='4H';pd.4.3='5H';pd.4.4='3H';pd.4.5='4H';pd.4.6='5H';pd.4.7='3H';pd.4.8='4H';pd.4.9='5H'
  87.  pd.5.1='9H';pd.5.2='0H';pd.5.3='1H';pd.5.4='9H';pd.5.5='0H';pd.5.6='1H';pd.5.7='9H';pd.5.8='0H';pd.5.9='1H'
  88.  
  89.  poptln='34H'
  90.  
  91.  optstr = 'H Q P SC 1 2 3 4 5 6 3K 4K FH SS LS C Y'
  92.  sstr = '1 2 3 4 5 6 3K 4K FH SS LS C Y' /* Scoreable string */
  93.  
  94. call setlines
  95.  
  96. if ~exists(datapath) then do
  97.  call makedir(datapath)
  98.  tempname = name
  99.  name = 'MATT_ENGLISH'    /* Has to be one file to match Scorelist */
  100.  call zerovar
  101.  call savedata
  102.  name = tempname
  103.  end
  104. if exists(datapath'/'name) then call loaddata
  105. else do
  106.  call zerovar
  107.  say''CLS''cr
  108.  say cr
  109.  say cr
  110.  say' A NEW PLAYER !!! 'cr
  111.  say' Welcome to Yacht_C !!!'cr
  112.  call delay(100)
  113.  newplayer = 1 /* first time player */
  114.  end
  115.  
  116. call refresh1
  117. call refresh2
  118. call setlines
  119.  
  120. /*
  121. Loop:
  122.  do forever
  123.   spotsleft = spotsleft - 1
  124.   if spotsleft = 0 then call done
  125.   call getopt
  126.   end  */
  127.  
  128. call getopt
  129.  
  130. zerovar:                           /* Variable values at startup */
  131.  s.1 = '' /* Score for the 1's */
  132.  s.2 = '';s.3='';s.4='';s.5='';s.6=''
  133.  sub='0';bon='0';utot='0';utot2='0'
  134.  s.3k='';s.4k='';s.fh='';s.ss='';s.ls='';s.c='';s.y='';ltot='0';tot='0'
  135.  hold.1='    ';hold.2='    ';hold.3='    ';hold.4='    ';hold.5='    '
  136.  rollsleft='3'
  137.  spotsleft = 13
  138.  dvalue.1 = 1;dvalue.2=2;dvalue.3=3;dvalue.4=4;dvalue.5=5
  139.  do t = 1 to 6
  140.   x.t = random(1,10)
  141.   end
  142.  dcstring = x.1' d1 'x.2' d2 'x.3' d3 'x.4' d4 'x.5' d5 'x.6' d6'
  143.  rvalue = 0
  144.  newplayer = 0
  145. return
  146.  
  147.  
  148. setlines:
  149.  low = bak.0||pen.1
  150.  hi = bak.2||pen.1
  151.  ln.1=''pen.1' [ 1] ones      (add 1''s)'def''
  152.  ln.2=''pen.1' [ 2] twos      (add 2''s)'def''
  153.  ln.3=''pen.1' [ 3] threes    (add 3''s)'def''
  154.  ln.4=''pen.1' [ 4] fours     (add 4''s)'def''
  155.  ln.5=''pen.1' [ 5] fives     (add 5''s)'def''
  156.  ln.6=''pen.1' [ 6] 'unl'sixes     (add 6''s)'def''
  157.  ln.3k=''pen.1' [3K] 3 of a kind (total)'def''
  158.  ln.4k=''pen.1' [4K] 4 of a kind (total)'def''
  159.  ln.fh=''pen.1' [FH] Full House     (25)'def''
  160.  ln.ss=''pen.1' [SS] Small Straight (30)'def''
  161.  ln.ls=''pen.1' [LS] Large Straight (40)'def''
  162.  ln.c=''pen.1' [ C] Chance      (total)'def''
  163.  if s.y = '' then ln.y=''pen.1' [ Y] 'unl'Yacht-C        (50)'def''unl''pen.1' |   'def''
  164.  if s.y = '50' then ln.y=''pen.1' [ Y] 'unl'Yacht-C        (50)'def''unl''pen.1' |'def''unl' 50'def''
  165.  if s.y = ' --' then ln.y=''pen.1' [ Y] 'unl'Yacht-C        (50)'def''unl''pen.1' |'def''unl' --'def''
  166. return
  167.  
  168. Loaddata:
  169.  call open(data,datapath'/'name,'R')
  170.  lastplay = readln(data)
  171.  colorset = readln(data)
  172.  if colorset = '' then
  173.    DO
  174.      IF ADDRESS()='BAUD' THEN colorset=1
  175.      ELSE colorset=5
  176.    END
  177.  call prefs(colorset)
  178.  say''CLS''cr
  179.  say cr
  180.  say cr
  181.  say' Welcome back to Yacht_C!!'cr
  182.  say' You last played this game on 'lastplay''cr
  183.  say cr
  184.  call delay(100)
  185.  options prompt''pen.4' Would you like to continue your last game? (Y,n) > '
  186.  pull continue
  187.  if continue = 'N' then do
  188.   call close(data)
  189.   call zerovar
  190.   return
  191.   end
  192.  call zerovar
  193.  say cr
  194.  say' Loading data, stand by ...'cr
  195.  again = 1
  196.  rollsleft = readln(data)
  197.  spotsleft = readln(data)
  198.  if spotsleft = 0 then do
  199.   call zerovar
  200.   call close(data)
  201.   return
  202.   end
  203.  do i = 1 to words(sstr)
  204.   j = word(sstr,i)
  205.   s.j = readln(data)
  206.   end
  207.  sub = readln(data)
  208.  bon = readln(data)
  209.  utot = Readln(data)
  210.  utot2 = readln(data)
  211.  ltot = Readln(data)
  212.  tot = readln(data)
  213.  do i = 1 to 5
  214.   dvalue.i = readln(data)
  215.   end
  216.  call close(data)
  217.  call refresh1
  218.  call refresh2
  219.  call setlines
  220.  call showdice
  221.  call getopt
  222.  
  223. savedata:
  224.  if exists(datapath'/'name) then call delete(datapath'/'name)
  225.  call open(data,datapath'/'name,'W')
  226.  thedate = date()
  227.  call writeln(data,thedate)
  228.  if colorset = '' then colorset = 1
  229.  call writeln(data,colorset)
  230.  call writeln(data,rollsleft)
  231.  call writeln(data,spotsleft)
  232.  do i = 1 to words(sstr)
  233.   j = word(sstr,i)
  234.   call writeln(data,s.j)
  235.   end
  236.  call writeln(data,sub)
  237.  call writeln(data,bon)
  238.  call writeln(data,utot)
  239.  call writeln(data,utot2)
  240.  call writeln(data,ltot)
  241.  call writeln(data,tot)
  242.  do i = 1 to 5
  243.   call writeln(data,dvalue.i)
  244.   end
  245.  call close(data)
  246. return
  247.  
  248. clrl:
  249.  arg what
  250.  if what = 0 then where = pprompt
  251.  if what = 1 then where = pprompt1
  252.  if what = 2 then where = poptln
  253.  if what = 3 then where = pprompt2
  254.  if what = 2 then color = bak.6
  255.  else color = def
  256.  say''where''color'                              'def'  '
  257. return
  258.  
  259. getopt:
  260.  if spotsleft = 0 then call done
  261.  call setopt
  262.  say''prollsleft''rollsleft''
  263.  call clrl(0)
  264.  call clrl(1)
  265.  do s = 1 to 5
  266.   hold.s = '    '
  267.   say''phold.s''hold.s''
  268.   end
  269.  if rollsleft = 3 then line = 'Hit 'pen.3'Return'def' 'pen.1'to Roll the dice'def' > '
  270.  if rollsleft = 2 | rollsleft = 1 then line = '   'pen.1'Enter the Option to take or 'def''
  271.  if rollsleft = 0 then line = ''pen.1'Enter your Option'def' > '
  272.  if rollsleft = 2 | rollsleft = 1 then do
  273.   say''pprompt''line''
  274.   options prompt''pprompt1'       'pen.3'Return'def' 'pen.1'to Roll 'def'> '
  275.   end
  276.  else options prompt''pprompt''line''
  277.  pull opt
  278.  opt = upper(strip(opt))
  279.  if rollsleft = 3 then do
  280.   select
  281.    when opt = H then call help
  282.    when opt = Q then call quit(1)
  283.    when opt = SC then call checkopt
  284.    when opt = P then do
  285.     call setPrefs
  286.     call getopt
  287.     end
  288.    otherwise call rolldice(12345)
  289.    end
  290.   end
  291.  if rollsleft = 2 | rollsleft = 1 then do
  292.   select
  293.    when opt = H then call help
  294.    when opt = Q then call quit(1)
  295.    when opt = P then do
  296.     call setPrefs
  297.     call getopt
  298.     end
  299.    when opt = '' then do
  300.     call holddice
  301.     call rolldice(pick)
  302.     end
  303.    otherwise call checkopt
  304.    end
  305.   end
  306.  if rollsleft = 0 then do
  307.   select
  308.    when opt = H then call help
  309.    when opt = Q then call quit(1)
  310.    when opt = P then do
  311.     call setPrefs
  312.     call getopt
  313.     end
  314.    when opt = '' then call getopt
  315.    otherwise call checkopt
  316.    end
  317.   end
  318. return
  319.  
  320. checkopt:
  321.  init = 0
  322.  if opt = SC then init = 1
  323.  if init = 0 then do i = 1 to words(optln)
  324.   testopt = word(optln,i)
  325.   if opt = testopt then init = 1
  326.   end
  327.  if init = 0 then do
  328.   call clrl(0)
  329.   call clrl(1)
  330.   say''pprompt''pen.2'INVALID Option!!'def''
  331.   call delay(100)
  332.   call getopt
  333.   end
  334.  if opt = 1 then s.1 = countin(dstring,'1')
  335.  if opt = 2 then s.2 = (countin(dstring,'2') * 2)
  336.  if opt = 3 then s.3 = (countin(dstring,'3') * 3)
  337.  if opt = 4 then s.4 = (countin(dstring,'4') * 4)
  338.  if opt = 5 then s.5 = (countin(dstring,'5') * 5)
  339.  if opt = 6 then s.6 = (countin(dstring,'6') * 6)
  340.  if opt = 3K then s.3K = dvalue.1 + dvalue.2 + dvalue.3 + dvalue.4 + dvalue.5
  341.  if opt = 4K then s.4K = dvalue.1 + dvalue.2 + dvalue.3 + dvalue.4 + dvalue.5
  342.  if opt = FH then s.FH = 25
  343.  if opt = SS then s.SS = 30
  344.  if opt = LS then s.LS = 40
  345.  if opt = C  then s.c = dvalue.1 + dvalue.2 + dvalue.3 + dvalue.4 + dvalue.5
  346.  if opt = Y  then s.Y = 50
  347.  if opt = SC then do
  348.   call clrl(0)
  349.   call clrl(1)
  350.   options prompt''pprompt'Which item to Scratch? > '
  351.   pull scit
  352.   itsok = 0
  353.   do i = 1 to words(sstr)
  354.    j = word(sstr,i)
  355.    if j = scit & s.j = '' then do
  356.     itsok = 1
  357.     call clrl(0)
  358.     options prompt''pprompt'Scratch 'scit'? (Y,n) > '
  359.     pull thething
  360.     if thething = 'N' then call getopt
  361.     s.scit = ' --'
  362.     end
  363.    end
  364.   if itsok = 0 then do
  365.    call clrl(0)
  366.    say''pprompt''pen.3'SAY WHAT?? Try again..'def''
  367.    call getopt
  368.    end
  369.   end
  370.  sub = 0
  371.  bon = 0
  372.  utot = 0
  373.  utot2 = 0
  374.  ltot = 0
  375.  tot = 0
  376.  do i = 1 to words(sstr)
  377.   thisscore = word(sstr,i)
  378.   if i < 7 then do
  379.    if s.thisscore = ' --' then do
  380.     s.thisscore = 0
  381.     scratch = 'YES'
  382.     end
  383.    if s.thisscore = '' then s.thisscore = 0
  384.    sub = sub + s.thisscore
  385.    if sub > 62 then bon = 35
  386.    utot = sub + bon
  387.    utot2 = utot
  388.    if s.thisscore = 0 then s.thisscore = ''
  389.    if scratch = 'YES' then do
  390.     s.thisscore = ' --'
  391.     scratch = 'NO'
  392.     end
  393.    end
  394.   if i > 6 then do
  395.    if s.thisscore = ' --' then do
  396.     s.thisscore = 0
  397.     scratch = 'YES'
  398.     end
  399.    if s.thisscore = '' then s.thisscore = 0
  400.    ltot = ltot + s.thisscore
  401.    tot = ltot + utot
  402.    if s.thisscore = 0 then s.thisscore = ''
  403.    if scratch = 'YES' then do
  404.     s.thisscore = ' --'
  405.     scratch = 'NO'
  406.     end
  407.    end
  408.   end
  409.  do i = 1 to words(sstr)
  410.   j = word(sstr,i)
  411.   if i = 6 | i = 'Y' then style = unl
  412.   else style = ''
  413.   nostyle = def
  414.   here = right(s.j,3)
  415.   say''ps.j''style''here''nostyle''
  416.   end
  417.  say''psub''right(sub,3)''
  418.  say''pbon''unl''right(bon,3)''def''
  419.  say''putot''right(utot,3)''
  420.  say''pltot''right(ltot,3)''
  421.  say''putot2''unl''right(utot2,3)''def''
  422.  say''ptot''right(tot,3)''
  423.  rollsleft = 3
  424.  spotsleft = spotsleft - 1
  425.  call getopt
  426.  
  427. /* call loop */
  428.  
  429.  
  430. sortstr:
  431.  call open(file,'ram:sortfile','W')
  432.  do i = 1 to 5
  433.   num = substr(dstring,i,1)
  434.   call writeln(file,num)
  435.   end
  436.  call close(file)
  437.  address command'sort Ram:sortfile ram:sorted'
  438.  call open(file,'ram:sorted','R')
  439.  az=readln(file)
  440.  bz=Readln(file)
  441.  cz=readln(file)
  442.  dz=readln(file)
  443.  ez=readln(file)
  444.  call close(file)
  445. return
  446.  
  447. setopt:               /* Hilight or Lowlight proper options */
  448.  dstring = dvalue.1||dvalue.2||dvalue.3||dvalue.4||dvalue.5
  449.  call sortstr
  450.  histr = ''
  451.  call clrl(2)
  452.  if rollsleft = 3 then do
  453.   call sethi(histr)
  454.   return
  455.   end
  456.  do l = 1 to 5              /* Chk for 1's thru 6's */
  457.   do m = 1 to 6
  458.    if dvalue.l = m & s.m = '' then do
  459.     if histr = '' then histr = m
  460.     else histr = histr||' 'm
  461.     end
  462.    end
  463.   end
  464.  temphi = ''
  465.  do i = 1 to 6
  466.   if instring(i,histr) then do
  467.    if temphi = '' then temphi = i
  468.    else temphi = temphi||' 'i
  469.    end
  470.   end
  471.  histr = temphi
  472.                /* Chk for 3K */
  473.  do l = 1 to 6
  474.   if countin(dstring,l) > 2 & s.3K = '' then do
  475.    if histr = '' then histr = '3K'
  476.    else histr = histr||' 3K'
  477.    end
  478.   end
  479.                /* Chk for 4K */
  480.  do l = 1 to 6
  481.   if countin(dstring,l) > 3 & s.4K = '' then do
  482.    if histr = '' then histr = '4K'
  483.    else histr = histr||' 4K'
  484.    end
  485.   end
  486.                /* chk for FH */
  487.  do l = 1 to 6
  488.   if countin(dstring,l) > 2 then
  489.    do m = 1 to 6
  490.     if m = l then iterate m
  491.     if countin(dstring,m) > 1 & s.FH = '' then do
  492.      if histr = '' then histr = 'FH'
  493.      else histr = histr||' FH'
  494.      end
  495.     end
  496.   end
  497.                /* Chk for SS */
  498.  test = 0
  499.  test1 = 0
  500.  skip = 0
  501.  if s.SS = '' then do z = 1 to 3
  502.   if instring(az+z,dstring) then test = test + 1
  503.   skip = 1
  504.   end
  505.  if test < 3 then skip = 0
  506.  if s.SS = '' & skip = 0 then do z = 1 to 3
  507.   if instring(ez-z,dstring) then test1 = test1 + 1
  508.   end
  509.  if test = 3 | test1 = 3 then do
  510.   histr = histr||' SS'
  511.   end
  512.  
  513.                /* Chk for LS */
  514.  test = 0
  515.  test1 = 0
  516.  skip = 0
  517.  if s.LS = '' then do z = 1 to 4
  518.   if instring(az+z,dstring) then test = test + 1
  519.   skip = 1
  520.   end
  521.  if test < 4 then skip = 0
  522.  if s.LS = '' & skip = 0 then do z = 1 to 4
  523.   if instring(ez-z,dstring) then test1 = test1 + 1
  524.   end
  525.  if test = 4 | test1 = 4 then do
  526.   histr = histr||' LS'
  527.   end
  528.  
  529.                /* Chance is automatic unless already taken */
  530.  if s.c = '' then histr = histr||' C'
  531.                /* Chk fo Yacht_C */
  532.  do i = 1 to 6
  533.   if countin(dstring,i) = 5 & s.Y = '' then do
  534.    histr = histr||' Y'
  535.    end
  536.   end
  537.  
  538.  call sethi(histr)
  539. return
  540.  
  541. sethi:
  542.  arg histr
  543.  if histr = '' then do
  544.   call setalllow
  545.   optln = 'H Q P SC'
  546.   optln = center(optln,30)
  547.   call clrl(2)
  548.   say''poptln''bak.6''pen.1''optln''def''
  549.   return
  550.   end
  551.  call setalllow
  552.  optln = 'H Q P SC'
  553.  do i = 1 to words(histr)
  554.   hiword = word(histr,i)
  555.   do j = 1 to words(optstr)
  556.    optword = word(optstr,j)
  557.    where = pln.hiword
  558.    what = ln.hiword
  559.    if hiword = optword then do
  560.     say''where''hi''what''def''
  561.     optln = optln' 'hiword
  562.     iterate i
  563.     end
  564.    else say''where''low''what''def''
  565.    end
  566.   end
  567.  optln = center(optln,30)
  568.  call clrl(2)
  569.  say''poptln''bak.6''pen.1''optln''def''
  570. return
  571.  
  572. setalllow:
  573.  low = bak.0||pen.1
  574.  hi = bak.2||pen.1
  575.  say''pln.1''low''ln.1''def''
  576.  say''pln.2''low''ln.2''def''
  577.  say''pln.3''low''ln.3''def''
  578.  say''pln.4''low''ln.4''def''
  579.  say''pln.5''low''ln.5''def''
  580.  say''pln.6''low''ln.6''def''
  581.  say''pln.3K''low''ln.3K''def''
  582.  say''pln.4K''low''ln.4K''def''
  583.  say''pln.FH''low''ln.FH''def''
  584.  say''pln.SS''low''ln.SS''def''
  585.  say''pln.LS''low''ln.LS''def''
  586.  say''pln.c''low''ln.c''def''
  587.  if s.y = '50' then say''pln.y''low' [ Y] 'unl'Yacht-C        (50)'def''unl''pen.1' |'def''unl' 50'def''
  588.  if s.y = '' then say''pln.y''low' [ Y] 'unl'Yacht-C        (50)'def''unl''pen.1' |   'def''
  589.  if s.y = ' --' then say''pln.y''low' [ Y] 'unl'Yacht-C        (50)'def''unl''pen.1' |'def''unl' --'def''
  590. return
  591.  
  592. CountIn: procedure
  593. arg str,dnum
  594.    points = 0
  595.    pos = 1
  596.    oldpos = 1
  597.    do while (pos ~== 0)
  598.       pos = index(str,dnum,oldpos)
  599.       if (pos ~==0) then do
  600.          points = points + 1
  601.          oldpos = pos + 1
  602.       end
  603.    end
  604. return(points)
  605.  
  606.  
  607. holddice:
  608. pick = ''
  609.  call clrl(0)
  610.  call clrl(1)
  611.  options prompt''pprompt'Hold which dice ? (0-5) > '
  612.  pull holdem
  613.  holdem = strip(holdem)
  614.  if holdem = '' then call getopt
  615.  if holdem = '0' then do
  616.   pick = '12345'
  617.   return
  618.   end
  619.  do t = 1 to 5
  620.   if instring(t,holdem) then hold.t = ''pen.5'HOLD'def''
  621.   else do
  622.    hold.t = '    '
  623.    if pick = '' then pick = t
  624.    else pick = pick||t
  625.    end
  626.   end
  627.  do s = 1 to 5
  628.   say''phold.s''hold.s''
  629.   end
  630.  call clrl(0)
  631.  options prompt''pprompt'Look right to you ? (Y,n) > '
  632.  pull answer
  633.  if answer = 'N' then call holddice
  634. return
  635.  
  636. instring: procedure
  637. arg letter,string
  638.  if (index(string,letter) == 0) then return 0
  639.   else return 1
  640.  
  641. rolldice:
  642.  arg toroll
  643.  do i=1 to length(toroll)
  644.   die = substr(toroll,i,1)
  645.   if rvalue = 0 then do
  646.    dvalue.die = getrandom()
  647.    rvalue = 1
  648.    end
  649.   else do
  650.    dvalue.die = random(1,6)
  651.    rvalue = 0
  652.    end
  653.   do
  654.    do w = 1 to 6
  655.     say''pd.die.w''pen.2''bak.1' 'def''
  656.     end
  657.    do w = 7 to 9
  658.     say''pd.die.w''pen.2''bak.1''unl' 'def''
  659.     end
  660.    end
  661.  
  662.   if dvalue.die = 1 then pd.die.1.v = ' '
  663.   else pd.die.1.v = 'O'
  664.   pd.die.2.v = ' '
  665.   if dvalue.die > 3 then pd.die.3.v = 'O'
  666.   else pd.die.3.v = ' '
  667.   if dvalue.die = 6 then pd.die.4.v = 'O'
  668.   else pd.die.4.v = ' '
  669.   if dvalue.die = 1 | dvalue.die = 3 | dvalue.die = 5 then pd.die.5.v = 'O'
  670.   else pd.die.5.v = ' '
  671.   if dvalue.die = 6 then pd.die.6.v = 'O'
  672.   else pd.die.6.v = ' '
  673.   if dvalue.die > 3 then pd.die.7.v = ''unl'O'
  674.   else pd.die.7.v = ''unl' '
  675.   pd.die.8.v = ''unl' '
  676.   if dvalue.die > 1 then pd.die.9.v = ''unl'O'
  677.   else pd.die.9.v = ''unl' '
  678.   do x = 1 to 9
  679.    if pd.die.x.v = ' ' then say''pd.die.x''pen.2''bak.1' 'def''
  680.    else say''pd.die.x''pen.2''bak.1''pd.die.x.v''def''
  681.    end
  682.  
  683.   end
  684.  rollsleft = rollsleft - 1
  685. call getopt
  686. exit
  687.  
  688. Help:
  689.  say''CLS''
  690.  say cr
  691.  say'    'pen.7'Yacht_C written by Matt English 7-29-93'def''cr
  692.  say cr
  693.  say'  Yacht_C is a fairly simple (and fun) dice game!'cr
  694.  say' The object is to fill your score card with all'cr
  695.  say' the options and achieve the highest possible score!'cr
  696.  say cr
  697.  say'  You get up to 3 rolls of the 5 dice for each turn.'cr
  698.  say' To roll the dice, just hit 'pen.3'RETURN'def' at the prompt,'cr
  699.  say' and you''ll be asked which dice you''d like to hold. Enter the'cr
  700.  say' numbers that appear over the dice you wanna hold, (1-5).'cr
  701.  say' After your first roll, you can 'pen.2'HOLD'def' any of the dice'cr
  702.  say' and re-roll the remaining dice. You don''t have to hold'cr
  703.  say' any dice if you wanna re-roll all of them.'cr
  704.  say cr
  705.  say'  You 'pen.3'MUST'def' score one item on your score card each turn!'cr
  706.  say' If there aren''t any available options, you 'pen.3'MUST SCRATCH'def''cr
  707.  say' one item. You will receive zero points for each scratched'cr
  708.  say' item, so try to avoid it..'cr
  709.  say cr
  710.  options prompt' 'pen.4'Hit return to continue...'def''
  711.  pull junk
  712.  say''cls''
  713.  say cr
  714.  say' 'pen.6'The Options:'def''cr
  715.  say cr
  716.  say' 1''s thru 6''s........ Add the total of all the matching dice.'cr
  717.  say' 3K (3 of a kind).... At least 3 dice match, Add all dice.'cr
  718.  say' 4K (4 of a kins).... At least 4 dice match, Add all dice.'cr
  719.  say' FH (Full House)..... 3 dice match AND 2 other dice match'cr
  720.  Say' SS (Small Straight). Run of 4 dice (1,2,3,4) (3,4,5,6)'cr
  721.  say' LS (Large Straight). Run of 5 dice (1,2,3,4,5) (2,3,4,5,6)'cr
  722.  say' C  (Chance)......... Take this when there are no other choices.'cr
  723.  say' Y  (Yacht_C)........ All five dice match.'cr
  724.  say cr
  725.  say' 'pen.5'BONUS!'def''cr
  726.  say cr
  727.  say'  If you can achieve a score of 63 or more on the upper part'cr
  728.  say' of the score sheet, you get a 35 point Bonus!'cr
  729.  say cr
  730.  options prompt' 'pen.4'Hit return to continue...'def''
  731.  pull junk
  732.  say''cls''
  733.  say cr
  734.  say' 'pen.5'Prefs:'def''cr
  735.  say cr
  736.  say'  Using Prefs will give you 6 options to adjust the colors'cr
  737.  say' that you see while playing this game. Your choice will be'cr
  738.  say' recorded and used each time you play the game. You can change'cr
  739.  say' it at any time.'cr
  740.  say cr
  741.  say'  If at any time your screen gets screwed up (phone noise,'cr
  742.  say' crazy fingers, ect..) Just re-read this help file, or go to'cr
  743.  say' the prefs utility and your screen will be re-drawn when you'cr
  744.  say' return to the game.'cr
  745.  say cr
  746.  say'  Your score will be automatically saved when you quit the game'cr
  747.  say' so that you can continue your game next call if you wish.'cr
  748.  say cr
  749.  say' 'pen.7'Hope you enjoy the game!'def''cr
  750.  say cr
  751.  options prompt' 'pen.4'Hit return to continue...'def''
  752.  pull junk
  753.  call refresh1
  754.  call refresh2
  755.  call showdice
  756.  call getopt
  757. return
  758.  
  759. setPrefs:
  760.  say''cls''cr
  761.  say cr
  762.  say cr
  763.  say' Since everyone has their color palettes set'cr
  764.  say' differently on their Comm programs, there is no'cr
  765.  say' way to tell how the colors for this game will'cr
  766.  say' look on your screen.'cr
  767.  say cr
  768.  say' This little utility will set and save your'cr
  769.  say' colors preferences for this game. You can 'cr
  770.  say' change them again at any time.'cr
  771.  say cr
  772.  say' ColorSet # 1       ColorSet # 2       ColorSet # 3'cr
  773.  say' ColorSet # 4       ColorSet # 5       ColorSet # 6'cr
  774.  say cr
  775.  options prompt' Enter a ColorSet # to use (1-6) > '
  776.  pull color
  777.  if color = '' then do
  778.   call refresh1
  779.   call refresh2
  780.   call setlines
  781.   call showdice
  782.   call getopt
  783.   end
  784.  if ~datatype(color,'W') then call setprefs
  785.  if color < 0 | color > 6 then call setprefs
  786.  call prefs(color)
  787.  say cr
  788.  options prompt' Enter "T" to test or RETURN to use > '
  789.  pull test
  790.  if test = 'T' then do
  791.   call refresh1
  792.   call refresh2
  793.   call setlines
  794.   options prompt''pprompt'Hit Return to continue'
  795.   pull junk
  796.   call setprefs
  797.   end
  798.  else do
  799.   call refresh1
  800.   call refresh2
  801.   call setlines
  802.   call showdice
  803.   call getopt
  804.   end
  805.  
  806.  
  807. Prefs:
  808.  arg colorset
  809.  if colorset = '' then colorset = 1
  810.  col.0=''
  811.  col.1=''
  812.  col.2=''
  813.  col.3=''
  814.  col.4=''
  815.  col.5=''
  816.  col.6=''
  817.  col.7=''
  818.  bakcol.0=''
  819.  bakcol.1=''
  820.  bakcol.2=''
  821.  bakcol.3=''
  822.  bakcol.4=''
  823.  bakcol.5=''
  824.  bakcol.6=''
  825.  bakcol.7=''
  826.  if colorset = 1 then do
  827.   do i = 0 to 7
  828.    pen.i = col.i
  829.    end
  830.   do i = 0 to 7
  831.    bak.i = bakcol.i
  832.    end
  833.   end
  834.  if colorset = 2 then do
  835.   do i = 1 to 7
  836.    if i = 7 then do
  837.     pen.i = col.1
  838.     iterate i
  839.     end
  840.    x = i + 1
  841.    pen.i = col.x
  842.    end
  843.   do i = 1 to 7
  844.    if i = 7 then do
  845.     bak.i = bakcol.1
  846.     iterate i
  847.     end
  848.    x = i + 1
  849.    bak.i = bakcol.x
  850.    end
  851.   end
  852.  if colorset = 3 then do
  853.  j = 0
  854.  k = 0
  855.   do i = 1 to 7
  856.    if i > 5 then do
  857.     j = j + 1
  858.     pen.i = col.j
  859.     iterate i
  860.     end
  861.    x = i + 2
  862.    pen.i = col.x
  863.    end
  864.   do i = 1 to 7
  865.    if i > 5 then do
  866.     k = k + 1
  867.     bak.i = bakcol.k
  868.     iterate i
  869.     end
  870.    x = i + 2
  871.    bak.i = bakcol.x
  872.    end
  873.   end
  874.  if colorset = 4 then do
  875.  j = 0
  876.  k = 0
  877.   do i = 1 to 7
  878.    if i > 4 then do
  879.     j = j + 1
  880.     pen.i = col.j
  881.     iterate i
  882.     end
  883.    x = I + 3
  884.    pen.i = col.x
  885.    end
  886.   do i = 1 to 7
  887.    if i > 4 then do
  888.     k = k + 1
  889.     bak.i = bakcol.k
  890.     iterate i
  891.     end
  892.    x = i + 3
  893.    bak.i = bakcol.x
  894.    end
  895.   end
  896.  if colorset = 5 then do
  897.  j = 0
  898.  k = 0
  899.   do i = 1 to 7
  900.    if i > 3 then do
  901.     j = j + 1
  902.     pen.i = col.j
  903.     iterate i
  904.     end
  905.    x = i + 4
  906.    pen.i = col.x
  907.    end
  908.   do i = 1 to 7
  909.    if i > 3 then do
  910.     k = k + 1
  911.     bak.i = bakcol.k
  912.     iterate i
  913.     end
  914.    x = i + 4
  915.    bak.i = bakcol.x
  916.    end
  917.   end
  918.  if colorset = 6 then do
  919.  j = 0
  920.  k = 0
  921.   do i = 1 to 7
  922.    if i > 2 then do
  923.     j = j + 1
  924.     pen.i = col.j
  925.     iterate i
  926.     end
  927.    x = i + 5
  928.    pen.i = col.x
  929.    end
  930.   do i = 1 to 7
  931.    if i > 2 then do
  932.     k = k + 1
  933.     bak.i = bakcol.k
  934.     iterate i
  935.     end
  936.    x = i + 5
  937.    bak.i = bakcol.x
  938.    end
  939.   end
  940.  
  941. return
  942.  
  943. getrandom:
  944.  call sortstr2
  945.  x = random(1,4)
  946.  if x = 1 then it = caz
  947.  if x = 2 then it = cbz
  948.  if x = 3 then it = ccz
  949.  if x = 4 then it = cdz
  950.  do
  951.   count = word(it,1)
  952.   num = word(it,2)
  953.   do ii = 1 to 6
  954.    testcount = word(dcstring,(ii*2)-1)
  955.    testnum = word(dcstring,ii*2)
  956.    if testnum = num then do
  957.     count = count + 1
  958.     if ii = 1 then tempstring = count' 'num
  959.     else tempstring = tempstring' 'count' 'num
  960.     end
  961.    else do
  962.     if ii = 1 then tempstring = testcount' 'testnum
  963.     else tempstring = tempstring' 'testcount' 'testnum
  964.     end
  965.    end
  966.   end
  967.   dcstring = tempstring
  968. return right(num,1)
  969.  
  970. sortstr2:
  971.  call open(file,'ram:sortfile2','W')
  972.  do ii = 1 to 6
  973.   num = word(dcstring,ii*2)
  974.   count = word(dcstring,(ii*2)-1)
  975.   call writeln(file,count num)
  976.   end
  977.  call close(file)
  978.  address command'sort Ram:sortfile2 ram:sorted2 NUMERIC'
  979.  call open(file,'ram:sorted2','R')
  980.  caz=readln(file)
  981.  cbz=Readln(file)
  982.  ccz=readln(file)
  983.  cdz=readln(file)
  984.  cez=readln(file)
  985.  cfz=readln(file)
  986.  call close(file)
  987. return
  988.  
  989. showdice:
  990.  do die = 1 to 5
  991.   if dvalue.die = 1 then pd.die.1.v = ' '
  992.   else pd.die.1.v = 'O'
  993.   pd.die.2.v = ' '
  994.   if dvalue.die > 3 then pd.die.3.v = 'O'
  995.   else pd.die.3.v = ' '
  996.   if dvalue.die = 6 then pd.die.4.v = 'O'
  997.   else pd.die.4.v = ' '
  998.   if dvalue.die = 1 | dvalue.die = 3 | dvalue.die = 5 then pd.die.5.v = 'O'
  999.   else pd.die.5.v = ' '
  1000.   if dvalue.die = 6 then pd.die.6.v = 'O'
  1001.   else pd.die.6.v = ' '
  1002.   if dvalue.die > 3 then pd.die.7.v = ''unl'O'
  1003.   else pd.die.7.v = ''unl' '
  1004.   pd.die.8.v = ''unl' '
  1005.   if dvalue.die > 1 then pd.die.9.v = ''unl'O'
  1006.   else pd.die.9.v = ''unl' '
  1007.   do x = 1 to 9
  1008.    if pd.die.x.v = ' ' then say''pd.die.x''pen.2''bak.1' 'def''
  1009.    else say''pd.die.x''pen.2''bak.1''pd.die.x.v''def''
  1010.    end
  1011.   end
  1012. return
  1013.  
  1014. refresh1:
  1015. low = bak.0||pen.1
  1016. hi = bak.2||pen.1
  1017. say''def''cls''cr
  1018. say''pen.1'      'unl'                    |   'def'    'pen.1''bak.5'Yacht_C 1.1 by Matt English'def''cr
  1019. say''pen.1' [ 1] ones      (add 1''s) |'def'       'cr
  1020. say''pen.1' [ 2] twos      (add 2''s) |   'def'   'unl''pen.2'  1  'def' 'unl''pen.2'  2  'def' 'unl''pen.2'  3  'def' 'unl''pen.2'  4  'def' 'unl''pen.2'  5  'def''cr
  1021. say''pen.1' [ 3] threes    (add 3''s) |      'bak.1''pen.2'|   |'def' 'bak.1''pen.2'|O  |'def' 'bak.1''pen.2'|O  |'def' 'bak.1''pen.2'|O O|'def' 'bak.1''pen.2'|O O|'def''cr
  1022. say''pen.1' [ 4] fours     (add 4''s) |      'bak.1''pen.2'| O |'def' 'bak.1''pen.2'|   |'def' 'bak.1''pen.2'| O |'def' 'bak.1''pen.2'|   |'def' 'bak.1''pen.2'| O |'def' 'cr
  1023. say''pen.1' [ 5] fives     (add 5''s) |      'unl''bak.1''pen.2'|   |'def' 'unl''bak.1''pen.2'|  O|'def' 'unl''bak.1''pen.2'|  O|'def' 'unl''bak.1''pen.2'|O O|'def' 'unl''bak.1''pen.2'|O O|'def'   'cr
  1024. say''pen.1' [ 6] 'unl'sixes     (add 6''s) |   'def'    'cr
  1025. say''pen.1'            Sub TOTAL     |  'def'             'cr
  1026. say''pen.1'            'unl'BONUS         |   'def'   'pen.3' "H" = Help'def'   'pen.3' "P" = Prefs'def''cr
  1027. say''pen.1'            Upper TOTAL   |      'pen.3' "Q" = Quit'def'   'pen.3'"SC" = Scratch'def''cr
  1028. say'                                              'cr
  1029. say''pen.1' [3K] 3 of a kind (total) | 'def''cr
  1030. say''pen.1' [4K] 4 of a kind (total) |      'bak.6'          'unl'Options :'def''bak.6'           'def''cr
  1031. say''pen.1' [FH] Full House     (25) |      'bak.6'                              'def' 'cr
  1032. say''pen.1' [SS] Small Straight (30) |      'bak.6'                              'def' 'cr
  1033. say''pen.1' [LS] Large Straight (40) | 'def''cr
  1034. say''pen.1' [ C] Chance      (total) | 'def''cr
  1035. say''pen.1' [ Y] 'unl'Yacht-C        (50) |   'def'        'cr
  1036. say''pen.1'            Lower TOTAL   | 'def''cr
  1037. say''pen.1'            'unl'Upper TOTAL   |   'def''cr
  1038. say''pen.1'            Game TOTAL    | 'def''cr
  1039. return
  1040.  
  1041. refresh2:
  1042. say''pplayer''player''
  1043. say''ps.1''right(s.1,3)''
  1044. say''ps.2''right(s.2,3)''
  1045. say''ps.3''right(s.3,3)''
  1046. say''ps.4''right(s.4,3)''
  1047. say''ps.5''right(s.5,3)''
  1048. say''ps.6''unl''right(s.6,3)''def''
  1049. say''psub''right(sub,3)''
  1050. say''pbon''unl''right(bon,3)''def''
  1051. say''putot''right(utot,3)''
  1052. say''ps.3k''right(s.3k,3)''
  1053. say''ps.4k''right(s.4k,3)''
  1054. say''ps.fh''right(s.fh,3)''
  1055. say''ps.ss''right(s.ss,3)''
  1056. say''ps.ls''right(s.ls,3)''
  1057. say''ps.c''right(s.c,3)''
  1058. say''ps.y''unl''right(s.y,3)''def''
  1059. say''pltot''right(ltot,3)''
  1060. say''putot2''unl''right(utot2,3)''def''
  1061. say''ptot''right(tot,3)''
  1062. say''phold.1''hold.1''
  1063. say''phold.2''hold.2''
  1064. say''phold.3''hold.3''
  1065. say''phold.4''hold.4''
  1066. say''phold.5''hold.5''
  1067. say''prollsleft''pen.1''rollsleft' 'pen.4'Rolls left this turn'def''
  1068. return
  1069.  
  1070. savescore:
  1071.  if ~exists(datapath'/scores') then do
  1072.   call open(win,datapath'/scores','W')
  1073.   call writeln(win,'100 MATT_ENGLISH 'date())
  1074.   call close(win)
  1075.   end
  1076.  if newplayer = 1 then do
  1077.   call open(win,datapath'/scores','A')
  1078.   call writeln(win,tot name date())
  1079.   call close(win)
  1080.   call sortscore
  1081.   call checkplace(1)
  1082.   call clrl(0)
  1083.   call clrl(1)
  1084.   fromtop = (scorecount - yspos) + 1
  1085.   call getpost
  1086.   say''pprompt'This game''s score was 'fromtop''post''
  1087.   say''pprompt1'  place outta 'scorecount' players!'
  1088.   call delay(250)
  1089.   end
  1090.  if newplayer = 0 then do
  1091.   call checkplace(1)
  1092.   if tot > oldtop then do
  1093.    call open(win,datapath'/scores','W')
  1094.    do i = 1 to scorecount
  1095.     call writeln(win,bestln.i)
  1096.     end
  1097.    call close(win)
  1098.    call sortscore
  1099.    call checkplace(2)
  1100.    call clrl(0)
  1101.    call clrl(1)
  1102.    say''pprompt'This score beats your previous'
  1103.    say''pprompt1'best of 'oldtop' from 'olddate2' 'olddate1' 'olddate3' !'
  1104.    fromtop = (scorecount - yspos) + 1
  1105.    call getpost
  1106.    say''pprompt2''fromtop''post' place outta 'scorecount' players!'
  1107.    call delay(250)
  1108.    call clrl(3)
  1109.    end
  1110.   else do
  1111.    call clrl(0)
  1112.    call clrl(1)
  1113.    say''pprompt'This didn''t beat your previous'
  1114.    say''pprompt1'best of 'ytopscore' from 'ytopdate2' 'ytopdate1' 'ytopdate3'..'
  1115.    fromtop = (scorecount - yspos) + 1
  1116.    call getpost
  1117.    say''pprompt2''fromtop''post' place outta 'scorecount' players!'
  1118.    call delay(250)
  1119.    call clrl(3)
  1120.    end
  1121.   end
  1122. return
  1123.  
  1124. getpost:
  1125.  if right(fromtop,2) > 10 & right(fromtop,2) < 14 then post = 'th'
  1126.  else do
  1127.   if right(fromtop,1) = 0 | right(fromtop,1) > 3 & right(fromtop,1) < 10 then post = 'th'
  1128.   if right(fromtop,1) = 1 then post = 'st'
  1129.   if right(fromtop,1) = 2 then post = 'nd'
  1130.   if right(fromtop,1) = 3 then post = 'rd'
  1131.   end
  1132. return
  1133.  
  1134. sortscore:
  1135.  address command'sort 'datapath'/scores Ram:sortscores numeric'
  1136.  address command'C:copy Ram:sortscores 'datapath'/scores QUIET'
  1137.  call delete('RAM:sortscores')
  1138. return
  1139.  
  1140. checkplace:
  1141.  arg times
  1142.  scorecount = 0
  1143.  call open(win,datapath'/scores','r')
  1144.  do until eof(win)
  1145.   scorecount = scorecount + 1
  1146.   bestln.scorecount = readln(win)
  1147.   if bestln.scorecount = '' then do
  1148.    scorecount = scorecount - 1
  1149.    break
  1150.    end
  1151.   if times ~= '3' & word(bestln.scorecount,2) = name then do
  1152.    yspos = scorecount                                  /* your score pos from bottom of list */
  1153.    ytopscore = word(bestln.scorecount,1)                              /* your top score */
  1154.    ytopdate1 = word(bestln.scorecount,3)                               /* the date you got the top score */
  1155.    ytopdate2 = word(bestln.scorecount,4)
  1156.    ytopdate3 = word(bestln.scorecount,5)
  1157.    if times = '1' & tot > ytopscore then do
  1158.     bestln.scorecount = tot name date()
  1159.     oldtop = ytopscore
  1160.     olddate1 = ytopdate1
  1161.     olddate2 = ytopdate2
  1162.     olddate3 = ytopdate3
  1163.     end
  1164.    end
  1165.   end
  1166.  call close(win)
  1167. return
  1168.  
  1169.  
  1170. done:
  1171.  call clrl(0)
  1172.  call clrl(1)
  1173.  say''pprompt'Checking your score against'
  1174.  say''pprompt1'the High Score list..'
  1175.  call delay(100)
  1176.  call savescore
  1177.  call clrl(0)
  1178.  call clrl(1)
  1179.  options prompt''pprompt'Wanna play again? (Y,n) > '
  1180.  pull playagain
  1181.  call zerovar
  1182.  if newplayer = 1 then call savedata
  1183.  newplayer = 0
  1184.  if playagain = 'N' then call quit(2)
  1185.  call refresh1
  1186.  call refresh2
  1187.  call setlines
  1188. /* call loop */
  1189.  call getopt
  1190.  end
  1191.  
  1192. quit:
  1193.  arg quitopt
  1194.  call clrl(0)
  1195.  call clrl(1)
  1196.  if quitopt ~= 2 then do
  1197.   options prompt''pprompt'Really Quit? (Y,n) > '
  1198.   pull this
  1199.   if this = 'N' then call getopt
  1200.   end
  1201.  
  1202. Break_C:
  1203. Break_E:
  1204.  call clrl(0)
  1205.  say''pprompt'Saving data, standby ....'
  1206.  call savedata
  1207.  if quitopt ~= 2 then call savescore
  1208.  if exists('ram:sortfile') then call delete('ram:sortfile')
  1209.  if exists('ram:sortfile2') then call delete('ram:sortfile2')
  1210.  if exists('ram:sorted') then call delete('ram:sorted')
  1211.  if exists('ram:sorted2') then call delete('ram:sorted2')
  1212.  call clrl(0)
  1213.  call clrl(1)
  1214.  call clrl(3)
  1215.  say''pprompt'Thanks for playing Yacht_C!'
  1216.  call delay(100)
  1217.  call checkplace(3)
  1218.  say''CLS''cr
  1219.  title = 'Top 15 Yacht_C Players!!!'
  1220.  title = center(title,70)
  1221.  say''pen.3''title''def''cr
  1222.  say cr
  1223.  line = bestln.scorecount
  1224.  score = left(word(line,1),5)
  1225.  name = left(word(line,2),20)
  1226.  date1 = left(word(line,4),4)
  1227.  date2 = left(word(line,3),3)
  1228.  yr = word(line,5)
  1229.  say'                 'pen.6''score''name''date1''date2''yr''def''cr
  1230.  do i = 1 to 14
  1231.   scorecount = scorecount - 1
  1232.   if scorecount = 0 then leave i
  1233.   line = bestln.scorecount
  1234.   score = left(word(line,1),5)
  1235.   name = left(word(line,2),20)
  1236.   date1 = left(word(line,4),4)
  1237.   date2 = left(word(line,3),3)
  1238.   yr = word(line,5)
  1239.   say'                 'pen.6''score''name''date1''date2''yr''def''cr
  1240.   end
  1241.  call delay(250)
  1242.  say cr
  1243.  say'   Bye!'cr
  1244.  exit
  1245.  
  1246. checkBBS:
  1247. IF ADDRESS()~='BAUD' THEN RETURN 0
  1248. IF TIME('E')>secs THEN SIGNAL BREAK_C
  1249. dcd
  1250. IF RC=0 THEN SIGNAL BREAK_C
  1251. temp=secs-TIME('E')
  1252. IF temp<120 THEN SAY '*** Only' temp 'seconds left! ***'CR 
  1253. RETURN 0
  1254.