/**************************************************************************\
|*                                                                        *|
|* The Wheel of Fortune, v6.0b; ANSI MODULE, by DOTORAN of Frontiers BBS! *|
|*                                                                        *|
\**************************************************************************/
options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
tr=transmit ; se=sendstring ; gc=getchar ; gu=getuser ; qu=query
bf=bufferflush ; changewhere 'WOF, v6.0 ANS!' ; oldwh=result
bbsidentify name ; bbsname=result ; bbsidentify sysop ; sysop=result
seed=random(0,1000,time('s')) ; call READCONFIG

BEGIN: /* Entry Point if Winner Chooses to RePlay the Game. */
    logs=0 ; log.='' ; wh=1 ; gu 1 ; handle=result ; action='Visited '
    gu 6 ; street=result ; gu 9 ; voice=result ; gu 10 ; data=result
    gu 41 ; sid=result ; date=date('s') ; gu 7 ; t=result ; timeleft=t%10||'.'||right(t,1)
    dateL=date('m',date,'s')||' '||strip(right(date,2),'l','0')||', '||left(date,4)
    gu 15 ; access=result ; gu 17 ; maintA=result
    cons='BCDFGHJKLMNPQRSTVWXYZ' ; vows='AEIOU'
    wheel='15 10 4 5 3 1 8 6 5 12 3 1 13 2 7 14 6 4 3  2 6 9 4 5'
    spots='BANKRUPT 750 250 300 200 100 500 400 300 FREE 200 100 SURPRISE '
    spots=spots||'150 450 LOSE 400 250 200  150 400 600 250 300'
    spotz=overlay('1000',spots,85) ; wheal=overlay('11',wheel,42)
    locs='2;34 3;41 4;43 5;45 6;47 7;49 8;50 9;49 10;47 11;44 12;43 13;41 14;34 '
    locs=locs||'13;32 12;30 11;28 10;26 9;24 8;23 7;24 6;26 5;28 4;30 3;32'
    colors='f e d c b a 9' ; freespins=0 ; cc=0 ; lo=0 ; sp=0 ; slow=0
    gu 24 ; cps=result ; if cps=960 then slow=sp96 ; if cps>960 then slow=sp14

    if ~exists(dfile||'GameData') then call SETUP

    call READPLAYERS ; if player=0 then do ; players=players+1
        player=players ; player.player=handle||'|0|0|0|0|0|0|0|0|x' ; end
    parse var player.player handle'|'puzwon'|'monwon'|'puznum'|'moncur'|',
                            played'|'percent'|'bonwins'|'boncash'|'junk
    key1='n1'||center(k1,78+(m1*3)) ; key2='n1'||center(k2,78+(m2*3))
    call READDATA ; call READSTATS ; call READWINNER ; call READWINNERS
    call READBWINNERS ; call READLASTPLAYER

START:
    tr 'f1@4' ; a='ce'||sysop||' c9Broadcasting cfPresentsca:n1'
    tr center(a,93) ; call TITLE
    tr center('cbBrought to you byc9: ca'||bbsname||' cfTV!n1',93)
    tr center('c6There are ce'||total||' c6Known Puzzles!',85)
    tr key1 ; call MENU

MAIN:
    se 'n1cf[ca'timeleft' ceMin.Leftcf] cbMenuc9: '
    se 'cf>>>--caHcf,ceYcf,caAcf,cePcf,caLcf,ceBcf,'
    se 'caOcf,ceNcf,caIcf,cdQcf,cb?cf=cbMenucf--> '
MAIN1:
    gc ; a=index('HALBYPONIQCE!?/M',result) ; call CHECK ; bf ; if a=0 then signal MAIN1
    if a=16 then do ; tr 'cbMaintenance#0'||dfile||'Maint}' ; changewhere 'WOF, v6.0 ANS!'
        if ~exists(dfile||'GameData') | ~exists(dfile||'Players') then exit ; else signal MAIN ; end
    if a=1 then do ; tr 'caHall of Fame' ; call HOFAME     ; signal MAIN ; end
    if a=2 then do ; tr 'ceAll Scores'   ; call ALLSCORES  ; signal MAIN ; end
    if a=3 then do ; tr 'caLast Puzzles' ; call LASTPUZS   ; signal MAIN ; end
    if a=4 then do ; tr 'caBonus Puzzles'; call BONUSPUZS  ; signal MAIN ; end
    if a=5 then do ; tr 'ceYour Stats'   ; call YOURSTATS  ; signal MAIN ; end
    if a=6 then do ; tr 'caPlay Game'    ; signal PLAYGAME ; end
    if a=7 then do ; tr 'ceOLD Game Log' ; tr '*0'||dfile||'Log.OLD.ANS}@4'key1
        call WL("ca"||handle||" c6veiwed the cfOLD cbGame Logc6.") ; signal MAIN ; end
    if a=8 then do ; tr 'caNEW Game Log' ; tr '*0'||dfile||'Log.NEW.ANS}@4'key1
        call WL("ca"||handle||" c6veiwed the ceNEW cbGame Logc6.") ; signal MAIN ; end
    if a=9 then do ; tr 'ceInstructions' ; call DOCS ; signal MAIN ; end
    if a=10 then do ; tr 'cdQuit Game'    ; call QUIT ; signal MAIN ; end
    if a=11 & Mflag=1 then do ; tr 'c9Cancel Game' ; signal CANCELGAME ; end
    if a=12 & Mflag=1 then do ; tr 'cdError Log List' ; a=exists(dfile||'wof.errors')
        if a=0 then do ; tr 'n1c6No c9Errors ceLoggedc6!n1'key1 ; signal MAIN ; end
        se '*0'||dfile||'wof.errors}n1c9Delete cbLog c6Now? c7[caNoc7]c6: ca' ; gc ; a=result
        if a~='Y' then do ; tr 'No.' ; signal MAIN ; end
        tr 'Yes!$odelete '||dfile||'wof.errors}' ; signal MAIN ; end
    if a=13 & Mflag=1 then do ; call open(f1,dfile||'LastPlayer','w')
        call writeln(f1,'0|No One|No Where|0|0|x') ; call close(f1)
        call READLASTPLAYER ; tr 'cePlay Game' ; signal PLAYGAME ; end
    if a>13 then do ; tr 'cbMain Menu' ; call MENU ; signal MAIN ; end
  signal MAIN1

PLAYGAME:
    if Lhan='No One' & play=0 & handle=winhan then do
        call WL("ca"||handle||" c6tried to play first, but was the cbLast Winnerc6!")
        se 'f1n1c6Pat comes up to you and whispers in your ear, cb"caSorry, cd'handle
        se 'ca, but ce'sysop' Broadcasting cadoesn''t allow recent winners to be '
        se 'the c9FIRST caplayer in a cfNEW cdGameca. You''ll have to wait until another '
        tr 'contestant has played the game.cb"n1'
        se 'c6On your way out of the studio, Vanna hands you a slip of paper. '
        tr 'Reading it, you discover the new puzzle.n1' ; call SHOWPUZZLE
        tr key2 ; signal QUIT2 ; end

    if handle=author then do
        call WL("ca"||handle||" c6tried to play, but is the cbAuthorc6!")
        se 'f1n1c6Vanna and Pat approach you from the wings.  Vanna gives '
        se 'you a playful slap on the butt. Pat says, cb"caNaughty. You wrote '
        tr 'the puzzle and must wait until someone wins.cb"n1'
        se 'c6After a moment, Pat continues, cb"caHowever, we will show you how '
        tr 'your puzzle is doing before you leave.cb"n1' ; call SHOWPUZZLE
        tr key2 ; signal QUIT2 ; end

    if newplay=0 & (sid=0 | access=0) then do
        call WL("ca"||handle||" c6tried to play, but was a cbGuestc6/cbNew Userc6!")
        se 'f1n1c6Pat looks at you quizically, cb"caYou''re c9NEW caaround here, aren''t '
        se 'you?  We do not currently allow c9NEW Users ca& c9GUESTS cato Play The Wheel of '
        tr 'Fortune, c9Sorrycb"n1'
        se '"caWe will, however, show you how the current puzzle is doing, in case '
        tr 'you''d like to play after you''ve been validated.cb"c6, Pat says.n1'
        call SHOWPUZZLE ; tr key2 ; signal QUIT2 ; end

    if Lflag=1 then do
        call WL("ca"||handle||" c6tried to play, but is the cdLast Playerc6!")
        se 'f1n1c6Pat laughs in your face and signals for a bouncer to '
        se 'throw you out of the studio. You were the last player and '
        tr 'must wait for someone else to play.n1'
    if chance=1 then do ; a=random(1,9) ; b=random(1,9) ; if a=b then do
            se 'As the bouncer approaches you, you kick him in the groin '
            se 'and run onto the studio set. Pat has no choice, but to let '
            tr 'you play again!n1'key1 ; Lhan='Bouncer in Agony!'
            call WL("ca"||handle||" c6beat up the cbBouncer c6to play again!")
            signal PLAYGAME2 ; end ; end
        se 'From over the bouncers shoulder, you get a glimpse of how '
        tr 'the current puzzle is doing...n1' ; call SHOWPUZZLE
        tr key2 ; signal QUIT2 ; end
PLAYGAME2:
    if puznum~=puzplay then do ; puznum=puzplay ; moncur=0
        if handle~=winhan then do ; played=played+1
            call WL("ca"||handle||" c6just ceentered c6this cbGamec6!")
            percent=((puzwon/played)*100)%1 ; end ; end

    if vanna=1 then do ; se 'f1n1c6Pat Sayjack welcomes you to the show, cb"caHow are you cd'||handle
    se 'ca? Glad to have you on the show. Hey Vanna, lets see some cleavage, '
    tr 'errr, I mean, lets see the puzzle!cb"n1'
    tr '[22Ccfo----------o  ce/   ////\\\ \      '
    tr '[22Ccf|ca    /\    cf|  ce\   \|n | n|\\     '
    tr '[22Ccf|ca   /--\   cf|  ce \   |  v  |\ \    '
    tr '[22Ccf|ca  /    \  cf|  ce  \   \_=_/\_\\\   '
    tr '[22Ccfo----------o  ce   \         \ \   '
    tr '[22C              ce    \/  /     \\   '
    tr '[22C  cb\  /        ce    /\_/\_ \   \   '
    tr '[22C  cb \/ anna    ce    \__\__\/\   \  '
    tr '[22C                     |     \   \ '
    tr '[22C                      \    /   / '
    tr key1 ; end

PLAY:
    if consonants=0 & vowels=0 then do ; solve=answer ; signal GUESSPUZZLE0 ; end
    if lo=0 then do ; lo=1
        if OLog=1 then tr 'f1c6Previous Game Logc9:n1*0'||dfile||'Log.OLD.ANS}@4'key1
        if NLog=1 then tr 'f1c6Current Game Logc9:n1*0'||dfile||'Log.NEW.ANS}@4'key1 ; end
    a=length(space(answer,0)) ; b=a-(consonants+vowels)
    if b/a>.50 & wh=1 then do ; spots=spotz
        tr 'n1c6Pat says, cb"caWe will now add c2$cb1000 cato the Wheel!cb"'
        tr key1 ; wheel=wheal ; wh=2 ; end
    tr 'f1c9*==========================================================================*'
    tr 'c9|cb>X<>X<>X<><><><>< >< >< >< >cer1 WHEEL OF FORTUNE r0cb< >< >< >< ><><><><>X<>X<>X<c9|'
    tr 'c9*==========================================================================*'
    tr 'z7c4                           Wheel Spots / Odds                               z0'
    if wh=1 then tr 'z7c4      1-$750, 1-$600, 1-$500, 1-$450, 3-$400, 3-$300, 3-$250, 3-$200,       z0'
    if wh=2 then tr 'z7c4  1-$1000, 1-$750, 1-$600, 1-$500, 1-$450, 3-$400, 3-$300, 3-$250, 2-$200,  z0'
    tr 'z7c4      2-$150, 2-$100, 1-Free Spin, 1-Lose Turn, 1-Bankrupt, 1-Surprise      z0n1'
    tr 'cfCurrent Puzzle Numberc9: ce'||left(puznum,20)||'cfLast Playerc9: cb'||Lhan
    tr 'cfCurrent Puzzle Authorc9: ca'||left(author,20)||'cfLast Winnerc9: cd'||winhan||'n1'
    se 'cfPLAYERc9: ce'left(handle,16)' cfWINNINGSc9: c2$ca' ; call CNUM(moncur)
    se left(a,9)' cfPREVIOUS WINNINGSc9: c2$ca' ; call CNUM(monwon) ; tr a'n1'
    tr '[20Ccf[cbScf]cbpin the Wheel     cf[ceBcf]ceuy a Vowel'
    tr '[20Ccf[caGcf]cauess the Puzzle   cf[cdQcf]cduit Playn1'
    call SHOWPUZZLE ; tr '[33CcfFree Spinsc9: ca'freespins'n1'
    if consonants>0 & vowels>0 then tr center('cbr1 Good Luck! r0',87)
    if consonants=0 then tr center('cer1 There are ONLY Vowels left in this Puzzle! r0',87)
    if vowels=0 then tr center('c9r1 There are NO MORE Vowels left in this Puzzle! r0',87)
    se 'n1cf[caPlaycf] >>>--cbScf,ceBcf,caGcf,cdQcf--> '
PLAY1:
    gc ; a=result ; call CHECK
    if index('SBGQ',a)=0 then do ; bf ; signal PLAY1 ; end
    if a='S' then do ; tr 'cbSpin Wheel'   ; signal SPINWHEEL   ; end
    if a='B' then do ; tr 'ceBuy Vowel'    ; signal BUYVOWEL    ; end
    if a='G' then do ; tr 'caGuess Puzzle' ; signal GUESSPUZZLE ; end
    if a='Q' then do ; tr 'cdQuit Play'    ; signal MAIN        ; end

SPINWHEEL:
    if consonants=0 then do ; se 'n1c6Pat reminds you, cb"cd'||handle||'ca, '
        tr 'caremember, there are cfONLY VOWELS caleft in this puzzle.cb"'
        call WL("ca"||handle||" c6tried to cfSPIN c6with ceONLY VOWELS c6left!")
        tr key1 ; signal PLAY ; end
    if Spin=0 then do ; se 'f1' ; a=random(25,60) ; sp=sp+a
        do until sp<30 ; sp=sp-25 ; end ; b=random(2,4)
        a=sp-b ; b=sp ; if a<1 then a=1 ; action='Played ' ; call D16
        do i=a to b ; ii=i ; if i>24 then ii=i-24 ; spot=word(wheel,ii)
            call D0 ; end i ; tr 'n9' ; end
    if Spin=1 then call D17
    if c=12 then signal FREESPIN ; if c=13 then signal SURPRISE
    if c=14 then signal LOSETURN ; if c=15 then signal BANKRUPT
    a='100 150 200 250 300 400 450 500 600 750 1000' ; money=word(a,c)
    tr 'cfThere is c2$ca'||money||' cfshowing on the cbWheelcf!n1'
SURPRISE0B:
    call SHOWPUZZLE
SPINWHEEL1:
    se '[scfType Your Guessc9:ca[3J ' ; gc ; guess=result
    call CHECK ; bf ; se guess ; call CNUM(money)
    if index(cons,guess)=0 then do ; se '[u' ; signal SPINWHEEL1 ; end
    log="c6With c2$ca"||a||" c6on cfThe Wheelc6, ca"||handle
    log=log||" c6guesses c9"||guess||"c6..." ; call WL(log)
    if index(guessed,guess)>0 then do
        call WL("c6Which was c9ALREADY cbGuessedc6!")
        se 'n2c6That caconsonant c6has cfalready c6been guessed...w1[u'
        signal SPINWHEEL1 ; end
    if index(answer,guess)>0 then do ; tr '  cf>>>---> caGOOD GUESS!'
        g=guessed ; if g='' then g=guess ; else g=g||'-'||guess
        guessed=g ; call COUNT ; consonants=consonants-tot
        call UNCOVER ; call COLORPUZZLE ; call COLORGUESSED ; Lhan=handle
        if tot=1 then call WL("c6There was ce1 c9"||guess||"c6 in the puzzle: "||puzzle2)
        if tot>1 then call WL("c6There were ce"||tot||" c9"||guess||"c6's in the puzzle: "||puzzle2)
        if index(cons,guess)>0 then moncur=moncur+(money*tot)
        if tot=1 then se 'n1[20Cc6There is ce1 cb"ca'||guess||'cb" '
            else se 'n1[20Cc6There are ce'||tot||' cb"ca'||guess||'cb"c6''s '
        tr 'c6in the puzzle.n1'||key1 ; signal PLAY ; end
    if index(answer,guess)=0 then do ; tr '  cf>>>---> c9WRONG!!'
        g=guessed ; if g='' then g=guess ; else g=g||'-'||guess
        guessed=g ; Lhan=handle ; call COLORGUESSED
        call WL("c6But there were cbNO c9"||guess||"c6's in the puzzle: "||guessed2)
        if freespins=0 then do ; tr 'n1Awwww... cbBetter Luck cfnext time.'
            call WL("ca"||handle||" c6is cffinished c6for this turn.")
            call SAVEPLAYERS ; call SAVEDATA ; signal QUIT2 ; end
        tr 'n1ceBut not to worry, cfYou have a cbFree Spincf!'
        call WL("c6However, ca"||handle||" c6has a cbFree Spinc6!")
        freespins=freespins-1 ; tr key1 ; signal PLAY ; end
FREESPIN:
    call WL("ca"||handle||" c6just landed on cbFREE SPINc6!")
    se 'n1c6Pat says, cb"caCongratulations cd'||handle||'ca, you now have a c9Free '
    tr 'Spinca!cb"' ; freespins=freespins+1 ; tr key1
  signal PLAY
LOSETURN:
    call WL("ca"||handle||" c6just landed on cdLOSE A TURNc6!")
    se 'n1c6Frowning, Pat tells you, cb"caUh Oh cd'||handle||'ca, looks like you '
    tr 'c9Lose a Turnca.cb"n1' ; if freespins>0 then do
        se 'cb"caThat''s alright, however, because you still have a cbFree '
        tr 'Spinca!cb"c6, Pat says consolingly.' ; freespins=freespins-1
        call WL("c6However, ca"||handle||" c6has a cbFree Spinc6!")
        tr key1 ; signal PLAY ; end
    se 'cb"caThat''s too bad, you weren''t doing all that bad. Well, you '
    tr 'can try again next callcb"c6, Pat mumbles.' ; Lhan=handle
    call WL("ca"||handle||" c6is cffinished c6for this turn.")
    call SAVEPLAYERS ; call SAVEDATA ; signal QUIT2
BANKRUPT:
    call WL("ca"||handle||" c6just landed on c9BANKRUPTc6!") ; call CNUM(moncur)
    call WL("ca"||handle||" c6loses c2$ca"||a||" c6bucks!")
    se 'n1cb"c9BANKRUPTca! Only one on the whole wheel, and cd'||handle||'ca, you '
    tr 'just found itcb"c6, Pat informs you.n1' ; moncur=0
    if freespins>0 then do
        tr 'cb"caLuckily you still have a cbFree Spinca!cb"c6, Pat praises.'
        call WL("c6However, ca"||handle||" c6has a cbFree Spinc6!")
        freespins=freespins-1 ; tr key1 ; signal PLAY ; end
    tr 'cb"caHopefully you''ll do better cfnext callca!cb"c6, Pat explains.'
    call WL("ca"||handle||" c6is cffinished c6for this turn.")
    Lhan=handle ; call SAVEPLAYERS ; call SAVEDATA ; signal QUIT2
SURPRISE:
    call WL("ca"||handle||" c6just landed on cfSURPRISEc6!")
    tr 'cb"caWow, ceSURPRISEca!cb"c6, Pat exclaims!n1'
    a=random(1,3) ; a='SURPRISE'||a ; signal (a)
SURPRISE1:
    call WL("ca"||handle||"c6's cfSURPRISE c6is a cbFREE SPINc6!")
    se 'cb"caWell, cd'||handle||' cayour ceSurprise cais a cbFREE SPINca!cb"c6, Pat informs '
    tr 'you.' ; freespins=freespins+1 ; tr key1 ; signal PLAY
SURPRISE2:
    if vowels=0 then signal SURPRISE3
    call WL("ca"||handle||"c6's cfSURPRISE c6is a ceFREE VOWELc6!")
    se 'cb"caHey cd'||handle||'ca, Congratulations, your ceSURPRISE cais to '
    tr 'cfBUY caa ceVOWEL cafor cfFREEca!cb"c6, Pat states.n1'
    moncur=moncur+250 ; signal SURPRISE0A
SURPRISE3:
    c=random(1000,1500) ; money=c ; call CNUM(money)
    call WL("ca"||handle||"c6's cfSURPRISE c6is c2$ca"||a||" c6on cfThe Wheelc6!")
    se 'c6Pulling out a white envelope, Pat opens it and says, cb"cd'||handle
    tr 'ca, this next guess will be worth c2$cb'||a||' bucks! cfGood Luckca!cb"n1'
  signal SURPRISE0B

BUYVOWEL:
    if vowels=0 then do ; se 'n1c6Pat reminds you, cb"cd'||handle||'ca, '
        tr 'remember, there are cfONLY CONSONANTS caleft in this puzzle.cb"'
        call WL("ca"||handle||" c6tried to cfBUY A VOWEL c6with ceONLY CONSONANTS c6left!")
        tr key1 ; signal PLAY ; end
    if moncur<300 then do
        call WL("ca"||handle||" c6tried to ceBUY c6a cbVowel c6with only c2$ca"||moncur||"c6!")
        se 'n1c6Pat informs you ceVowels Cost c2$ca250c6, and that you''ll '
        tr 'need at least c2$ca300 c6to buy one!n1'||key1 ; signal PLAY ; end
    se 'f1n5c6Turning towards you, Pat says, cb"cd'||handle||'ca, enter the '
    tr 'ceVOWEL cayou wish to ceGuessca. Remember, this will cost you c2$cb250ca!cb"n1'
SURPRISE0A:
    call SHOWPUZZLE ; action='Played '
BUYVOWEL1:
    se '[scfType Your Guessc9:[3J ce' ; gc ; guess=result
    call CHECK ; bf ; se guess
    if index(vows,guess)=0 then do ; se '[u' ; signal BUYVOWEL1 ; end
    call WL("ca"||handle||" ceBUYS c6the cbVowel c9"||guess||"c6...")
    if index(guessed,guess)>0 then do
        call WL("c6But that cbVowel c6was c9Already c6guessed!")
        se 'n1c6That cavowel c6has cfalready c6been guessed...w1[u'
        signal BUYVOWEL1 ; end
    if index(answer,guess)>0 then do ; tr '  cf>>>---> caGOOD GUESS!'
        g=guessed ; if g='' then g=guess ; else g=g||'-'||guess
        guessed=g ; call COUNT ; vowels=vowels-tot
        call UNCOVER ; call COLORPUZZLE ; call COLORGUESSED ; moncur=moncur-250
        if tot=1 then call WL("c6There was ce1 c9"||guess||"c6 in the puzzle: "||puzzle2)
        if tot>1 then call WL("c6There were ce"||tot||" c9"||guess||"c6's in the puzzle: "||puzzle2)
        if tot=1 then se 'n1[20Cc6There is ce1 cb"ca'||guess||'cb" '
            else se 'n1[20Cc6There are ce'||tot||' cb"ca'||guess||'cb"c6''s '
        tr 'c6in the puzzle.n1'||key1 ; signal PLAY ; end
    if index(answer,guess)=0 then do ; tr '  cf>>>---> c9WRONG!!'
        g=guessed ; if g='' then g=guess ; else g=g||'-'||guess
        guessed=g ; Lhan=handle ; call COLORGUESSED ; moncur=moncur-250
        call WL("c6But there were cbNO c9"||guess||"c6's in the puzzle: "||guessed2)
        if freespins=0 then do ; tr 'n1Awwww... cfBetter luck c6next time.'
        call WL("ca"||handle||" c6is cffinished c6for this turn.")
            call SAVEPLAYERS ; call SAVEDATA ; signal QUIT2 ; end
        tr 'n1c6But not to worry, cfYou have a cbFree Spincf!'
        call WL("c6However, ca"||handle||" c6has a cbFree Spinc6!")
        freespins=freespins-1 ; tr key1 ; signal PLAY ; end

GUESSPUZZLE:
    if zero=0 & moncur<100 then do
        se 'n1c6Pat wipes his brow, then looks at you, cb"caSorry, cd'||handle
        se 'ca, but you need more than c2$cb100 cabefore you can attempt to cfGUESS '
        tr 'cathis puzzle!cb"n1'key1 ; signal PLAY ; end
    se 'f1n5c6Startled, Pat asks, cb"caSo, cd'||handle||'ca, you think you know '
    tr 'this puzzle.  Well, cfgood luck cain guessing it!cb"n1'
    call WL("ca"||handle||" c6will try and cfSOLVE c6the puzzle...")
    call SHOWPUZZLE ; len=length(puzzle)
    tr 'n1cfType your cbGuess cfbelow the ceCurrent Puzzlec9:n1'
    tr 'cf The Puzzle Nowc9: 'translate(puzzle2,hide,'@')
    tr 'cfYour Best Guessc9: cai129 '||len||'}'
    gu 70 ; solve=result ; call CHECK
    if solve~=answer then do
        call WL("c6But, alas, more cbSTUDY c6is needed for this puzzle!")
        se 'c6Shaking his head, Pat tells you, cb"caI''m sorry cd'||handle
        tr 'ca, but that''s c9not cathe correct answer.cb"n1'
        Lhan=handle ; if freespins=0 then do
        tr 'n1c9Awwww... c6Try again when a cbfew more letters c6are showing.'
            call WL("ca"||handle||" c6is cffinished c6for this turn.")
            call SAVEPLAYERS ; call SAVEDATA ; signal QUIT2 ; end
        tr 'n1c6But not to worry, cfYou have a cbFree Spincf!'
        call WL("c6However, ca"||handle||" c6has a cbFree Spinc6!")
        freespins=freespins-1 ; tr key1 ; signal PLAY ; end
GUESSPUZZLE0:
    if solve=answer then do
        call WL("cfCongratulations c6to ca"||handle||" c6who just cbSOLVED c6the puzzle!")
        se 'f1n1c6Clapping his hands, Pat says, cb"caCongratulations cd'||handle ; call CNUM(moncur)
        tr 'ca, You''ve just won c2$cb'a' cain cfCASH caand cfPRIZESca!cb"'
        if puPR>0 then do ; call CNUM(puVA)
            se 'n1c6For c9winning c6the game, cb'||sysop||' Broadcasting c6has decided '
            se 'to give you ca'||a||' ce'||pr.puPR||'c6!  Enjoy them!n1'
            if puPR=1 then addtime (puVA) ; if puPR=2 then addpoints (puVA)
            if puPR=3 then do ; gu 35 ; b=result ; b=b+puVA ; setobject (b) ; putuser 35 ; end
            if puPR=4 then do ; gu 34 ; b=result ; b=b+puVA ; setobject (b) ; putuser 34 ; end
            call WL("ca"||handle||" c6was awarded cf"||a||" c9"||pr.puPR||"c6 for solving this cfPuzzlec6!") ; end
        puzwon=puzwon+1 ; winhan=handle ; windate=date ; wins=puzwon
        winpuz=answer ; played=played+1 ; monwon=monwon+moncur
        winmon=monwon ; percent=((puzwon/played)*100)%1
        winner=winhan'|'winpuz'|'windate'|'winmon'|'wins'|x'
        winners=winners+1 ; winner.winners=winhan'|'winpuz'|'windate'|x'
        l.1='cc'||right('cf'||dateL,78,'=')||'cc===' ; l.2='cf  The Win Datec9: cb'dateL
        l.3='cf    The Puzzlec9: ce'||answer ; l.4='cf   Puzzle Cluec9: ca'||clue ; call CNUM(winmon)
        l.5='cf Puzzle Winnerc9: cd'||handle ; l.6='cfTotal Winningsc9:c2$ca'||a
        do i=1 to 6 ; call WL(l.i) ; end i ; if winners>max1 then do ; winners=max1
            do i=2 to max1+1 ; j=i-1 ; winner.j=winner.i ; end i ; end
        if played>mostplays then do ; se 'n1c6Pat says, cb"cd'||handle
            tr 'ca, you c9broke cathe old cfMOST PLAYS caRecord!cb"'
            call WL("ce  A NEW RECORDc9: cfPlayed the caMOST cfTimes!")
            mostplaysH=winhan ; mostplays=played ; end
        if wins>mostpuzs then do ; se 'n1c6Pat says, cb"cd'||handle
            tr 'ca, you c9broke cathe old cfMOST PUZZLES caRecord!cb"'
            call WL("ce  A NEW RECORDc9: cfWon the caMOST cfPuzzles!")
            mostpuzsH=winhan ; mostpuzs=wins ; end
        if monwon>mostbank then do ; se 'n1c6Pat says, cb"cd'||handle
            tr 'ca, you c9broke cathe old cfMOST TOTAL WINNINGS caRecord!cb"'
            call WL("ce  A NEW RECORDc9: cfWon the caMOST cfBucks cdEVERcf!")
            mostbankH=winhan ; mostbank=monwon ; end
        if moncur>mostcash then do ; se 'n1c6Pat says, cb"cd'||handle
            tr 'ca, you c9broke cathe old cfMOST WINNINGS caRecord!cb"'
            call WL("ce  A NEW RECORDc9: cfWon the caMOST cfBucks in cdONE GAMEcf!")
            mostcashH=winhan ; mostcash=moncur ; end
        stats.1=mostplaysH'|'mostplays'|x' ; stats.2=mostpuzsH'|'mostpuzs'|x'
        stats.3=mostbankH'|'mostbank'|x'   ; stats.4=mostcashH'|'mostcash'|x'
        call SAVEWINNERS ; call SAVEWINNER ; call SAVESTATS ; call SAVEPLAYERS
        call WL("c9"||right("ce"||dateL,78,'-')||"c9---") ; call BONUSROUND
        se 'n1c6Shaking your hand, Pat tells you, cb"caAs the cfnewest cbWheel of '
        tr 'Fortune ceWinnerca, you have to make a choice.cb"n1'
        tr '>5cf1c9: ceI want to enter the next puzzle.n1'
        tr '>5cf2c9: c6Let cd'||bbsname||' cbGenerate c6next puzzle.c7(cdDEFAULTc7)'
        tr '>8c7(c6You''ll be able to cbplay c6a cbGENERATED c6Puzzle!c7)n1'
        se 'cfWhat''s your choice, cd'||handle||'cf? ' ; gc ; a=result
        if a~='1' then signal GENERATE

MAKEPUZZLE:
    tr 'ceI''ll make it!'
    se 'n1cb"caOK, cd'||handle||'ca, Please enter your cePuzzleca:cb"c6, '
    tr 'Pat asks fervently.n1'
    tr '[scfPuzzlec9:ca[3Ji129 50}' ; gu 70 ; a=result ; a=strip(a,'b')
    if result='###PANIC' | result='' then signal GENERATE
    if length(a)<9 then do
        se 'c6Whispering in your ear, caVanna c6tells you that '
        se 'puzzle is cbtoo c6short.w2[u' ; signal MAKEPUZZLE ; end
    se 'cb"ca'||a||'cb"n2cfIs this correct cd'||handle||'cf? (caYcf/cbncf)c9: '
    gc ; b=result ; if result='###PANIC' then signal GENERATE
    if b~='N' then do ; tr 'caYes!' ; newpuz=a ; end
    if b='N' then do ; se 'cbNo. ceTry Againw1[u' ; signal MAKEPUZZLE ; end
    se 'n1cb"caNow enter a cfClue cafor your cfPuzzleca, cd'||handle||'cb"c6, '
    tr 'Pat guides you.n1'
MAKECLUE:
    tr '[scf  Cluec9:ce[3Ji129 20}' ; gu 70 ; a=result ; a=strip(a,'b')
    if result='###PANIC' | result='' then signal GENERATE
    if length(a)<3 then do
        se 'n1c6Pinching your butt, caVanna c6gives you the sign that '
        se 'your clue is cbtoo c6short.w2[u' ; signal MAKECLUE ; end
    se 'cb"ca'||a||'cb"n2cfIs this correct cd'||handle||'cf? (caYcf/cbncf)c9: '
    gc ; b=result ; if result='###PANIC' then signal GENERATE
    if b~='N' then do ; tr 'caYes!' ; newclue=a ; end
    if b='N' then do ; se 'cbNo. ceTry Againw1[u' ; signal MAKECLUE ; end
    author=handle ; a=exists(dfile||'NewPuz')
    if a=0 then call open(f1,dfile||'NewPuz','w')
    if a=1 then call open(f1,dfile||'NewPuz','a')
        z=newpuz'|'newclue'|'author'|x' ; call writeln(f1,z)
    call close(f1) ; call WL("ca"||handle||" c6decided to ceMAKE c6the next puzzle...")
  signal GENERATE2

GENERATE:
    tr 'c6Generate cfNEW cePuzzlec6!'
    call open(f1,dfile||'PuzData','r') ; a=strip(readch(f1,5),'t',d2c(0))
        if nextpuznum>a then nextpuznum=1
        ptr=((nextpuznum*90)-90)+5 ; call seek(f1,ptr,'b')
        p=strip(readch(f1,50),'t',d2c(0)) ; c=strip(readch(f1,20),'t',d2c(0))
        a=strip(readch(f1,20),'t',d2c(0)) ; call close(f1) ; nextpuznum=nextpuznum+1
    newpuz=translate(p,reverse(xrange('!','~')),xrange('!','~'))
    newclue=translate(c,reverse(xrange('!','~')),xrange('!','~'))
    author=translate(a,reverse(xrange('!','~')),xrange('!','~'))
    call WL("ca"||handle||" c6decided to let ce"||bbsname||" c6choose the next puzzle...")

GENERATE2:
    puzplay=puzplay+1 ; consonants=0 ; vowels=0 ; guessed=''
    do i=1 to length(newpuz) ; z=substr(newpuz,i,1)
        if index(cons,z)>0 then consonants=consonants+1
        if index(vows,z)>0 then vowels=vowels+1
    end i ; answer=newpuz ; Lhan='No One' ; clue=newclue
    puzzle=translate(answer,,xrange('A','Z'),'@') ; call SAVELOG
    if exists(dfile||'Log.OLD.ASC') then se '$odelete '||dfile||'Log.OLD.ASC}$orename '||dfile||'Log.NEW.ASC '||dfile||'Log.OLD.ASC}'
    if exists(dfile||'Log.OLD.ANS') then se '$odelete '||dfile||'Log.OLD.ANS}$orename '||dfile||'Log.NEW.ANS '||dfile||'Log.OLD.ANS}'
    if exists(dfile||'Log.OLD.IBM') then se '$odelete '||dfile||'Log.OLD.IBM}$orename '||dfile||'Log.NEW.IBM '||dfile||'Log.OLD.IBM}'
    call open(f1,dfile||'LastPlayer','w') ; call writeln(f1,'0|No One|No Where|0|0|x') ; call close(f1)
    log.1='cfNEW cbGame c6Started Onc9: cb'||dateL
    log.2='cf     The NEW Puzzlec9: ce'||puzzle ; log.3='cf    NEW Puzzle Cluec9: ca'||clue
    log.4='cf  NEW Puzzle Authorc9: cd'||author ; log.5='cc'||right('cf'||dateL,78,'=')||'cc==='
    logs=5 ; call SAVELOG ; se 'n1cfPat c6& caVanna c6would like to cfThank You c6for playing '
    se 'cbWheel of Fortune c6today, and hope to see you as a cacontestant '
    tr 'c6again someday!n1' ; aut=author ; call SAVEDATA
    if play=1 & handle~=aut then do
        se 'Pat asks, cb"caWould you like to be the c9FIRST caplayer of the '
        se 'cfNEW caGame cd'handle'ca?cb"n2c6(cayc6/cbNc6)cf: '
        gc ; a=result ; if a='Y' then do ; tr 'caYes!' ; signal BEGIN ; end
        else tr 'cbNo.' ; end
    changewhere oldwh ; if exists(dfile||'Reg.ASC') then tr 'f1*0'||dfile||'Reg.ANS}'
  exit

BONUSROUND:
    call WL("ca"||handle||" c6is eligible to play the cfBONUS Roundc6...")
    se 'n1c6Would cbYOU c6like to caPlay c6the cfBonus Roundc6? c7[caYesc7]c6: ca' ; gc ; a=result
    if a='N' then do ; tr 'No.' ; call WL("c6But ca"||handle||" c9declinesc6 playing! Why?!?") ; return ; end
    tr 'Yes!' ; call WL("cfAlrightc6, ca"||handle||" c6accepts the challenge...") ; changewhere 'WOF, v6.0 BONUS'
    call open(f1,dfile||'PuzData','r') ; a=strip(readch(f1,5),'t',d2c(0))
        if nextbonpuz<1 then nextbonpuz=a ; npn=nextbonpuz
        do until length(p)>=minB ; ptr=((npn*90)-90)+5 ; call seek(f1,ptr,'b')
        p=strip(readch(f1,50),'t',d2c(0)) ; npn=npn-1 ; end
        c=strip(readch(f1,20),'t',d2c(0)) ; a=strip(readch(f1,20),'t',d2c(0))
    call close(f1) ; newpuz=translate(p,reverse(xrange('!','~')),xrange('!','~'))
    newclue=translate(c,reverse(xrange('!','~')),xrange('!','~')) ; answer=newpuz
    author=translate(a,reverse(xrange('!','~')),xrange('!','~')) ; clue=newclue
    puzzle=translate(answer,,xrange('A','Z'),'@') ; len=length(puzzle)
    prize=random(100,500)*100 ; call CNUM(prize) ; let='RSTNLE'
    tr 'f1>5c9o----------------------------------------------------------------o'
    tr '>5c9|cb>X<>X<>X<>X<>X<>X<r1ce Welcome to the Bonus Round r0cb>X<>X<>X<>X<>X<>X<c9|'
    tr '>5c9o----------------------------------------------------------------on1'
    se 'c6Pat explains the cfBonus Roundc6, cb"caYou''ll be trying to solve a puzzle in a '
    se 'set amount of time.  We''ll give you the letters ceRca, ceSca, ceTca, ceNca, ceLca, and ceEca.  '
    se 'You will also be asked for c6twoc7(c62c7) camore consonants, and c6onec7(c61c7) camore vowel. '
    se 'If you can solve the cfBonus Puzzle cabefore time runs out, you''ll win '
    tr 'today''s cbCash cdPrize caof c2$cb'||a||' cfbucksca!cb"n1'
    tr '>8c6The Bonus Puzzlec9: ce'translate(puzzle,Hide,'@')'n1'
    tr '>ac6The Bonus Cluec9: ca'clue
    do ii=1 to 6 ; guess=substr(let,ii,1) ; call UNCOVER ; end ii ; tr
BROUND1:
    se '[sc6Enter catwoc7(ca2c7) c6more cbconsonantsc9:[3Jcai129 2}'
    gu 70 ; a=result ; a1=left(a,1) ; a2=right(a,1)
    if smart=1 & index(let,a1)~=0 then tr 'n1The consonant 'a1' was already given to you.w1[u^1'
    if smart=1 & index(let,a2)~=0 then tr 'n1The consonant 'a2' was already given to you.w1[u^1'
    if smart=1 & (index(let,a1)~=0 | index(let,a2)~=0) then signal BROUND1 ; else tr
BROUND2:
    se '[sc6Enter caonec7(ca1c7) c6more  cbvowel c6nowc9:[3Jcai129 1}' ; gu 70 ; a3=result
    if smart=1 & index(let,a3)~=0 then do ; tr 'n1The vowel 'a3' was already given to you.w1[u^1' ; signal BROUND2 ; end
    do ii=1 to 3 ; guess=substr(a1||a2,ii,1) ; call UNCOVER ; end ii ; call COLORPUZZLE
    se 'n1c6Vanna nudges Pat to bring him out of his stupor, cb"caStart typing your answer '
    se 'as soon as you see the entire screen cd'||handle||'ca, as the timer will begin '
    se 'counting down immediately!  Alright, cd'||handle||'ca, press any key when '
    tr 'you''re ready to start the cfBonus Roundca!cb"n1'key1
    tr 'f1>4c9o------------------------------------------------------------------o'
    tr '>4c9|cc>X<>X<>X<>X<>X<>X<r1cf Can You Win the Bonus Round? r0cc>X<>X<>X<>X<>X<>X<c9|'
    tr '>4c9o------------------------------------------------------------------on1'
    se '>5c6The Bonus Prize isc9: c2$ca' ; call CNUM(prize) ; tr a' cfbucksc6!n1'
    tr '>4c6Bonus Letters Givenc9: cdRce-cdSce-cdTce-cdNce-cdLce-cdEce-cd'left(a1,1)'ce-cd'right(a1,1)'ce-cd'a2'n1'
    tr '>6c6The Bonus Clue isc9: ca'clue'n1'
    tr '>4c6The Bonus Puzzle isc9: 'translate(puzzle2,hide,'@')'n1'
    tr '>bc6Timec9: ca'right(timer,4)'  c9> cf' ; z='' ; t=timer
GUESS:
    se '[13;18Hca'||right(t,4)||'  c9> cf'||z||'cd_ '
    maygetchar ; a=result ; if t<=0 then do ; bf ; signal OUTOFTIME ; end
    if a='NOCHAR' then do ; t=t-1 ; signal GUESS ; end
    if a=d2c(8)  & z~='' then do ; z=left(z,length(z)-1) ; t=t-1 ; signal GUESS ; end
    if a=d2c(13) & z=answer then signal GOODGUESS
    if a=d2c(13) & z~=answer then signal BADGUESS
    z=z||upper(a) ; t=t-1 ; signal GUESS

OUTOFTIME:
    call WL("ca"||handle||" c9ran out of time c6in the cfBonus Roundc6!")
    se 'n2c6Pat looks at Vanna and frowns, cb"caI''m sorry cd'||handle||'ca, but '
    se 'catime has run out.  Hopefully, we''ll see you in another cfBonus '
    tr 'Roundca sometime soon!cb"n1'key1 ; tr 'f1'
  signal ENDBONUS

GOODGUESS:
    call WL("cfCongratulations c6to ca"||handle||" c6who just cbSOLVED c6the cfBONUS Puzzlec6!")
    se 'n2c6Jumping up and down, you grab Vanna in a bear hug and she squeals. '
    se 'Pat confronts you, cb"caCalm down cd'||handle||'ca, great job, you solved '
    se 'today''s cfBonus Puzzleca, and win c2$cb' ; call CNUM(prize) ; tr a' cfbucks cadoing it!cb"n1'key1
    if bpPR>0 then do ; call CNUM(bpVA)
        se 'n1c6For c9solving c6the ceBONUS c6Puzzle, cb'||sysop||' Broadcasting c6has decided '
        se 'to give you ca'||a||' ce'||pr.bpPR||'c6!  Enjoy them!n1'key1
        if bpPR=1 then addtime (bpVA) ; if bpPR=2 then addpoints (bpVA)
        if bpPR=3 then do ; gu 35 ; b=result ; b=b+bpVA ; setobject (b) ; putuser 35 ; end
        if bpPR=4 then do ; gu 34 ; b=result ; b=b+bpVA ; setobject (b) ; putuser 34 ; end
        call WL("ca"||handle||" c6was awarded cf"||a||" c9"||pr.bpPR||"c6 for solving the ceBonus Puzzlec6!") ; end
    bonwins=bonwins+1 ; boncash=boncash+prize ; tr 'f1'
    if bonwins>mostbwins then do ; se 'n1c6Pat says, cb"cd'||handle
        tr 'ca, you c9broke cathe old cfMOST BONUS WINS caRecord!cb"'
        call WL('ce  A NEW RECORDc9: cfWon the caMOST BONUS GAMES cdEVERcf!')
        mostbwinsH=handle ; mostbwins=bonwins ; end
    if boncash>mostbcash then do ; se 'n1c6Pat says, cb"cd'||handle
        tr 'ca, you c9broke cathe old cfMOST BONUS CASH caRecord!cb"'
        call WL('ce  A NEW RECORDc9: cfWon the caMOST BONUS CASH cdEVERcf!')
        mostbcashH=handle ; mostbcash=boncash ; end
    stats.5=mostbwinsH'|'mostbwins'|x' ; stats.6=mostbcashH'|'mostbcash'|x'
    bwinner=handle'|'answer'|'date'|'prize'|'bonwins'|x' ; bwinners=bwinners+1
    bwinner.bwinners=handle'|'answer'|'date'|'prize'|x' ; if bwinners>max2 then do
        do i=2 to max2+1 ; j=i-1 ; bwinner.j=bwinner.i ; end i ; bwinners=max2 ; end
    call SAVESTATS ; call SAVEBWINNER ; call SAVEBWINNERS ; call SAVEPLAYERS
  signal ENDBONUS

BADGUESS:
    call WL("ca"||handle||" c9incorrectly guessed c6the cfBonus Puzzlec6!")
    se 'n2c6Looking at the white card in his hand, Pat walks over to you, cb"caI''m '
    se 'sorry cd'||handle||'ca, but that''s an incorrect guess of this cfBonus '
    tr 'Puzzleca. Better luck next time, eh?cb"n1'key1 ; tr 'f1'
  signal ENDBONUS

ENDBONUS:
    call READDATA ; nextbonpuz=npn-1 ; call SAVEDATA ; changewhere 'WOF, v6.0 ANS!'
  return

CANCELGAME: /* SysOp Command; Cancels & AutoGenerates a NEW Game */
    tr 'n1c6Pat asks, cb"caYou really want to c9CANCEL cathis Game?cb"'
    se 'n1c6(cayc6/cbNc6) cf>>>---> ' ; call COLORPUZZLE
    gc ; a=result ; if a~='Y' then do ; tr 'cbNo!' ; signal MAIN ; end
    call WL("z4cf   "||sysop||" has decided to c9CANCEL cfthis game! (Errors?)  z0n1")
    call WL("cf     The Puzzle Wasc9: ce"||puzzle2||"n1")
    call WL("cf     The Answer Wasc9: ca"||answer||"n1")
    tr 'caYes!n1' ; signal GENERATE

COUNT:
    tot=0 ; len=length(answer)
    do i=1 to len ; a=substr(answer,i,1)
    if guess=a then tot=tot+1 ; end i
  return

UNCOVER:
    do i=1 to len ; z=substr(answer,i,1)
    if guess=z then puzzle=overlay(guess,puzzle,i,1) ; end i
  return

SHOWPUZZLE:
    tr 'cf Current Puzzlec9: 'translate(puzzle2,Hide,'@')
    tr 'cf    Puzzle Cluec9: ca'clue
    tr 'cfGuessed Lettersc9: cd'guessed2
  return

COLORPUZZLE:
    a='' ; do i=1 to length(puzzle) ; b=substr(puzzle,i,1)
    if b='@' then a=a||'ce@' ; else a=a||'cb'||b
    end i ; puzzle2=a
  return

COLORGUESSED:
    a='' ; do i=1 to length(guessed) ; b=substr(guessed,i,1)
    if b='-' then a=a||'ce-' ; else a=a||'cd'||b
    end i ; guessed2=a
  return

CNUM: /* Comma Number Parser (Place commas inside numbers) */
    parse arg a ; b=length(a) ; if b=4 then a=insert(',',a,1,1)
    if b=5 then a=insert(',',a,2,1) ; if b=6 then a=insert(',',a,3,1)
    if b=7 then do ; a=insert(',',a,1,1) ; a=insert(',',a,5,1) ; end
  return

SAVELASTPLAYER:
    a=sid'|'handle'|'street'|'voice'|'data'|x'
    call open(f1,dfile||'LastPlayer','w') ; call writeln(f1,a) ; call close(f1)
  return

READLASTPLAYER:
    call open(f1,dfile||'LastPlayer','r') ; a=readln(f1) ; call close(f1)
    parse var a Lsid'|'Lhan'|'Lstr'|'Lvoi'|'Ldat'|'j ; Lflag=0 ; Mflag=0
    if sid=Lsid | handle=Lhan | street=Lstr | voice=Lvoi | data=Ldata then Lflag=1
    if maint=1 & sid=1 then Mflag=1 ; if maint=2 & access=23 then Mflag=1
    if maint=3 & access=31 then Mflag=1 ; if maint=4 & maintA>0 then Mflag=1
  return

WL: ; parse arg log ; logs=logs+1 ; log.logs=log ; return

SAVELOG:
    a='ANS IBM ASC' ; se 'n1c6Updating calogsc6...'
    do i=1 to 3 ; b=subword(a,i,1) ; f='Log.NEW.'||b
        call open(f1,dfile||f,substr('wa',exists(dfile||f)+1,1))
            do j=1 to logs ; if i=1 then call writeln(f1,log.j)
                if i=2 then call writeln(f1,translate(log.j,'ÄÍ','-='))
                if i=3 then do ; do until c=0 ; c=index(log.j,'')
                    if c>0 then log.j=delstr(log.j,c,3) ; end ; call writeln(f1,log.j) ; end
            end j ; call close(f1) ; end i ; tr 'hbed!'
  return

HOFAME:
    call WL("ca"||handle||" c6viewed the cfHALL OF FAMEc6!")
    tr 'f1n1c6Pat says, cb"caHere are the cfHigh Scores cd'||handle||'ca!cb"n1'
    tr 'ca'right(mostplaysH,16)' cfplayed  ceMost Games EVERcf; cb'mostplays' cftotal!' ; call CNUM(mostbank)
    tr 'cb'right(mostbankH,16)' cfwon the cdMost Money EVERcf; c2$ca'a' cfbucks!'
    tr 'ca'right(mostpuzsH,16)' cfwon the ceMost Games EVERcf; cb'mostpuzs' cftotal!' ; call CNUM(mostcash)
    tr 'cb'right(mostcashH,16)' cfwon the cdMost Money In 1  Gamecf; c2$ca'a' cfbucks!'
    tr 'ca'right(mostbwinsH,16)' cfwon the ceMost BONUS Games EVERcf; cb'mostbwins' cftotal!' ; call CNUM(mostbcash)
    tr 'cb'right(mostbcashH,16)' cfwon the cdMost BONUS Cash  EVERcf; c2$ca'a' cfbucks!'
    tr key1
  return

YOURSTATS:
    call WL("ca"||handle||" c6viewed current cbGAME STATSc6!")
    tr 'f1n1c6Pat says, cb"caHere are your stats cd'||handle||'ca!cb"n1' ; call CNUM(monwon)
    tr 'cfYou have won ca'||puzwon||' cfGames, for a total of c2$ca'||a||' cfbucks!'
    tr 'cfYou are currently playing Puzzle Number ce'||puznum||'cf.'
    tr 'cfYou have played cbWheel of Fortune cd'played' cftimes.'
    tr 'cfYou solved the puzzle ca'percent'c2% cfof the times you played!'
    tr 'cfYou have won the ceBONUS cfRound ce'bonwins' cftimes.' ; call CNUM(boncash)
    tr 'cfYou have won c2$ca'a' cfbucks in ceBONUS cfRounds!n1'key1
  return

ALLSCORES:
    call WL("ca"||handle||" c6viewed cdALL PLAYER SCORESc6!")
    tr 'f1n1c6Pat says, cb"caHere are c9ALL caof the cfScores cd'||handle||'ca!!cb"n1'
    tr 'z7c4 Wheel of Fortune     Total     Money  Play   Money  Max  Win Bonus     Bonus z0'
    tr 'z7c4 Player Alias(Handle)  Wins    Earned  Puz#     Now Play    %  Wins  Earnings z0'
    tr 'c9=============================================================================='
    parse var player.player d1'|'d2'|'d3'|'d4'|'d5'|'d6'|'d7'|'d8'|'d9'|'j
    call CNUM(d3) ; a1=a ; call CNUM(d5) ; a2=a ; call CNUM(d9) ; a3=a
    se 'cbr1*'||right(d1,20)||'  '||right(d2,4)||'  '||right('$'||a1,8)||'  '||right(d4,4)||' '
    tr right('$'||a2,7)||' '||right(d6,4)||' 'right(d7||'%',4)||'  '||right(d8,4)||'  '||right('$'||a3,8)||' r0'
    do i=1 to players ; se 'ca' ; if i//2=0 then se 'cb'
        if i=player then z='r1*' ; else z=' '
        parse var player.i d1'|'d2'|'d3'|'d4'|'d5'|'d6'|'d7'|'d8'|'d9'|'j
        call CNUM(d3) ; a1=a ; call CNUM(d5) ; a2=a ; call CNUM(d9) ; a3=a
        se z||right(d1,20)||'  '||right(d2,4)||'  '||right('$'||a1,8)||'  '
        se right(d4,4)||' '||right('$'||a2,7)||' '||right(d6,4)||' '||right(d7||'%',4)
        tr '  '||right(d8,4)||'  '||right('$'||a3,8)||' r0' ; if i//15=0 then do
        se 'cf>>>--cdEntercf-->' ; gc ; a=result ; if a=d2c(13) then se 'hd'
        else do ; tr ' ccAbort' ; leave i ; end ; end ; end i
    tr 'c9==============================================================================n1'key1
  return

LASTPUZS:
    call WL("ca"||handle||" c6viewed the ceLAST "||max1||" WINNERSc6!")
    tr 'f1c6Pat says, cb"caHere are the ceLast '||max1||' Winnersca, cd'||handle||'ca!cb"n1'
    do i=1 to winners ; d1=windate.i
        d=date('m',d1,'s')||' '||strip(right(d1,2),'l','0')||', '||left(d1,4)
        se 'ce'||winhan.i||' cfsolved cb'||winpuz.i
        tr ' cfon ca'||d||'cf.'
    end i ; tr key1
  return

BONUSPUZS: /* Display Last "max2" Bonus Puzzles */
    call WL("ca"||handle||" c6viewed the ceLAST "||max2||" BONUS WINNERSc6!")
    tr 'f1c6Pat says, cb"caHere are the ceLast '||max2||' c9Bonus Puzzle ceWinnersca, cd'||handle||'ca!cb"n1'
    do i=1 to bwinners ; d1=bwindate.i ; call CNUM(bwincash.i)
        d=date('m',d1,'s')||' '||strip(right(d1,2),'l','0')||', '||left(d1,4)
        se 'ce'||bwinhan.i||' cfsolved cb'||bwinpuz.i
        tr ' cfon cd'||d||'cf, and won c2$ca'||a||' cfbucks!'
    end i ; tr key1
  return

DOCS:
    call WL("ca"||handle||" c6viewed the ccINSTRUCTIONSc6!")
    tr '*0'||dfile||'Docs.ANS}'
  return

CHECK:
    if result~='###PANIC' then return
    tr 'n1No Carrier!' ; logentry 'No Carrier in WOF, v6.0!'
    call WL("ca"||handle||" c9Lost Carrier c6during the game!")
  signal QUIT2

QUIT:
    se 'n1c6You cfreally c6wish to cbQUITc6? (caYc6/cbnc6)c9: '
    gc ; a=result ; if a='N' then do ; tr 'cbNo.' ; return ; end
    tr 'caYes!' ; call SAVEPLAYERS ; call SAVEDATA
QUIT2:
    call WL("ca"||handle||" cf"||action||"cbWheel of Fortune, v6.0!")
    call WL("c9"||right('ce'||dateL,78,'-')||'c9---')
    logentry 'cf'action'cbWheel of Fortunecf, vce6.0cf!'
    if exists(dfile||'Reg.ANS') then tr 'f1*0'||dfile||'Reg.ANS}'
    if Lhan=handle then call SAVELASTPLAYER
    call SAVELOG ; bf ; changewhere oldwh
  exit

MENU: /* Main Menu for Wheel of Fortune */
    tr 'f1n1[5Cc9O-----------------------------------------------------------------O'
    tr '[5Cc9| cfVersion ce6.0b                                  cbNovember 30, 1993 c9|'
    tr '[5Cc9|                                                                 c9|'
    a=copies('>X<',10)||'cfr1 The Wheel Of Fortune Main Menu! r0cc'||copies('>X<',10)
    tr '[5Cc9|cc'center(a,77)'c9|'
    tr '[5Cc9|                                                                 c9|'
    tr '[5Cc9|  c6Completely cfReWritten c6byc9: cdDotoran c6of cbFrontiers c6(cd716c6)/cb823c6-cb9892c6!  c9|'
    tr '[5Cc9|                                                                 |'
    a=copies('>X<',10)||'cfr1 '||bbsname||' r0cc'||copies('>X<',10)
    tr '[5Cc9|cc'center(a,77)'c9|'
    tr '[5Cc9|                                                                 |'
    tr '[5Cc9|    cf<caHcf>caall of Fame        cf<cePcf>celay cbWOF ceGame      cf<caOcf>cald Game Log    c9|'
    tr '[5Cc9|    cf<ceYcf>ceour Game Stats     cf<caLcf>caast '||left(max1||' Puzzles',10)||'    cf<ceNcf>ceew Game Log    c9|'
    tr '[5Cc9|    cf<caAcf>call Player Stats    cf<ceBcf>ceonus Puzzles      cf<caIcf>canstructions    c9|'
    if Mflag=1 then tr '[5Cc9|    c7<c9Cc7>c9ancel This Game    c7<cdEc7>cdrrors Listing     c7<cbMc7>cbaintenance!    c9|'
    tr '[5Cc9|                                                                 |'
    tr '[5Cc9O-----------------------------------------------------------------O'
    tr '[25Ccf<cdQcf>cduit cbWheel of Fortune cdGamen1'
    tr '[25Cc6The Last Player Wasc9: ca'Lhan
  return

READCONFIG: /* Read "ConfigData" File. Holds info on game settings. */
    call open(f1,'pfiles:WoFortune.Config','r')
        do 2 ; j=readln(f1) ; end ; dfile=readln(f1)
        do 3 ; j=readln(f1) ; end ; a1=readln(f1) ; a2=readln(f1)
        parse var a1 m1'|'k1'|'j ; parse var a2 m2'|'k2'|'j
        do 2 ; j=readln(f1) ; end ; a3=readln(f1)
        parse var a3 OLog'|'NLog'|'Play'|'j'|'hide'|'j'|'spin'|'j'|'timer'|',
                     zero'|'max1'|'max2'|'minB'|'vanna'|'maint'|'chance'|',
                     smart'|'newplay'|'sp96'|'sp14'|'puPR'|'puVA'|'bpPR'|',
                     bpVA'|'j
    call close(f1) ; call open(f1,dfile||'PuzData','r')
    total=strip(readch(f1,5),'t',d2c(0)) ; call close(f1)
    pr.1='Extra Minutes' ; pr.2='Game Points' ; pr.3='Byte Credits' ; pr.4='File Credits'
  return

READDATA: /* Read "GameData" File. Holds info on current game. */
    call open(f1,dfile||'GameData','r') ; puzplay=readln(f1)
        puzzle=readln(f1) ; answer=readln(f1) ; guessed=readln(f1)
        clue=readln(f1)   ; data1=readln(f1)  ; data2=readln(f1)
    call close(f1) ; parse var data1 author'|'nextpuznum'|'nextbonpuz'|'j
    parse var data2 consonants'|'vowels'|'j
    puzzle=translate(puzzle,reverse(xrange('!','~')),xrange('!','~'))
    answer=translate(answer,reverse(xrange('!','~')),xrange('!','~'))
    author=translate(author,reverse(xrange('!','~')),xrange('!','~'))
    clue=translate(clue,reverse(xrange('!','~')),xrange('!','~'))
    call COLORPUZZLE ; call COLORGUESSED
  return

SAVEDATA: /* Save "GameData" File. */
    puzzle=translate(puzzle,reverse(xrange('!','~')),xrange('!','~'))
    answer=translate(answer,reverse(xrange('!','~')),xrange('!','~'))
    author=translate(author,reverse(xrange('!','~')),xrange('!','~'))
    clue=translate(clue,reverse(xrange('!','~')),xrange('!','~'))
    data1=author'|'nextpuznum'|'nextbonpuz'|x' ; data2=consonants'|'vowels'|x'
    call open(f1,dfile||'GameData','w') ; call writeln(f1,puzplay)
        call writeln(f1,puzzle)  ; call writeln(f1,answer)
        call writeln(f1,guessed) ; call writeln(f1,clue)
        call writeln(f1,data1)   ; call writeln(f1,data2)
    call close(f1)
  return

READBWINNERS: /* Read "BWinners" File. The Past 20 Winners. */
    call open(f1,dfile||'BWinners','r')
        do i=1 until eof(f1) ; bwinner.i=readln(f1)
            parse var bwinner.i bwinhan.i'|'bwinpuz.i'|'bwindate.i'|'bwincash.i'|'j
        end i ; bwinners=i-1
    call close(f1)
  return

SAVEBWINNERS: /* Save "BWinners" File. */
    call open(f1,dfile||'BWinners','w')
        do i=1 to bwinners ; call writeln(f1,bwinner.i) ; end i
    call close(f1)
  return

READWINNERS: /* Read "Winners" File. The Past 20 Winners. */
    call open(f1,dfile||'Winners','r')
        do i=1 until eof(f1) ; winner.i=readln(f1)
            parse var winner.i winhan.i'|'winpuz.i'|'windate.i'|'j
        end i ; winners=i-1
    call close(f1)
  return

SAVEWINNERS: /* Save "Winners" File. */
    call open(f1,dfile||'Winners','w')
        do i=1 to winners ; call writeln(f1,winner.i) ; end i
    call close(f1)
  return

SAVEBWINNER: /* Save "BWinner" File. */
    call open(f1,dfile||'BWinner','w')
        call writeln(f1,bwinner)
    call close(f1)
  return

READWINNER: /* Read "Winner" File. Who was the LAST Winner? */
    call open(f1,dfile||'Winner','r')
        winner=readln(f1)
    call close(f1)
    parse var winner winhan'|'winpuz'|'windate'|'winmon'|'wins'|'j
  return

SAVEWINNER: /* Save "Winner" File. */
    call open(f1,dfile||'Winner','w')
        call writeln(f1,winner)
    call close(f1)
  return

READSTATS: /* Read "Stats" File & Initialize These Variables. */
    call open(f1,dfile||'Stats','r')
        do i=1 to 6 ; stats.i=readln(f1) ; end i
    call close(f1)
    parse var stats.1 mostplaysH'|'mostplays'|'j
    parse var stats.2 mostpuzsH'|'mostpuzs'|'j
    parse var stats.3 mostbankH'|'mostbank'|'j
    parse var stats.4 mostcashH'|'mostcash'|'j
    parse var stats.5 mostbwinsH'|'mostbwins'|'j
    parse var stats.6 mostbcashH'|'mostbcash'|'j
  return

SAVESTATS: /* Save "Stats" File. */
    call open(f1,dfile||'Stats','w')
        do i=1 to 6 ; call writeln(f1,stats.i) ; end i
    call close(f1)
  return

READPLAYERS: /* Read "Players" File & Mark Current Player if Exists. */
    call open(f1,dfile||'Players','r') ; player=0
        do i=1 until eof(f1) ; player.i=readln(f1)
            parse var player.i han'|'j
            if han=handle then player=i
        end i ; players=i-1
    call close(f1)
  return

SAVEPLAYERS: /* Save "Players" File. */
    player.player=handle'|'puzwon'|'monwon'|'puznum'|'moncur'|'played'|'percent'|'bonwins'|'boncash'|x'
    call open(f1,dfile||'Players','w')
        do i=1 to players ; call writeln(f1,player.i) ; end i
    call close(f1) ; address command "sort "||dfile||"Players "||dfile||"Players"
  return

SETUP:
    tr '#0'||dfile||'SetUp}' ; return

D0: /* Call The Correct Wheel Graphic Location */
    b='D'||spot ; c=spot ; se 'f0n1' ; signal (b)
D1: /* 100 */
    tr '[0m[20C[47m         [1;32;42m*[47m     [42m*****[47m    [42m*****[47m        [0m'
    tr '[20C[1;32;47m        [42m**[47m    [42m*[47m     [42m*[47m  [42m*[47m     [42m*[47m       [0m'
    tr '[20C[1;32;47m         [42m*[47m    [42m*[47m     [42m*[47m  [42m*[47m     [42m*[47m       [0m'
    tr '[20C[1;32;47m         [42m*[47m    [42m*[47m [41m [C[47m  [42m*[47m  [42m*[47m     [42m*[47m       [0m'
    tr '[20C[1;32;47m       [42m*****[47m   [42m*[41m [C[42m**[47m    [42m*****[47m        [0m'
  return
D2: /* 150 */
    tr '[0m[20C[47m         [1;33;43m*[47m     [43m*****[47m    [43m*****[47m        [0m'
    tr '[20C[1;33;47m        [43m**[47m    [43m*[47m        [43m*[47m     [43m*[47m       [0m'
    tr '[20C[1;33;47m         [43m*[47m     [43m*****[47m   [43m*[47m     [43m*[47m       [0m'
    tr '[20C[1;33;47m         [43m*[47m      [41m [C[47m  [43m*[47m  [43m*[47m     [43m*[47m       [0m'
    tr '[20C[1;33;47m       [43m*****[47m   [43m*[41m [C[43m**[47m    [43m*****[47m        [0m'
  return
D3: /* 200 */
    tr '[0m[20C[47m      [1;36;44m*****[47m    [44m*****[47m    [44m*****[47m        [0m'
    tr '[20C[1;36;47m           [44m*[47m  [44m*[47m     [44m*[47m  [44m*[47m     [44m*[47m       [0m'
    tr '[20C[1;36;47m      [44m*****[47m   [44m*[47m     [44m*[47m  [44m*[47m     [44m*[47m       [0m'
    tr '[20C[1;36;47m     [44m*[47m        [44m*[47m [41m [C[47m  [44m*[47m  [44m*[47m     [44m*[47m       [0m'
    tr '[20C[1;36;47m      [44m*****[47m    [44m*[41m [C[44m**[47m    [44m*****[47m        [0m'
  return
D4: /* 250 */
    tr '[0m[20C[47m      [1;35;45m*****[47m    [45m*****[47m    [45m*****[47m        [0m'
    tr '[20C[1;35;47m           [45m*[47m  [45m*[47m        [45m*[47m     [45m*[47m       [0m'
    tr '[20C[1;35;47m      [45m*****[47m    [45m*****[47m   [45m*[47m     [45m*[47m       [0m'
    tr '[20C[1;35;47m     [45m*[47m          [41m [C[47m  [45m*[47m  [45m*[47m     [45m*[47m       [0m'
    tr '[20C[1;35;47m      [45m*****[47m    [45m*[41m [C[45m**[47m    [45m*****[47m        [0m'
  return
D5: /* 300 */
    tr '[0m[20C[47m      [1;34;46m*****[47m    [46m*****[47m    [46m*****[47m        [0m'
    tr '[20C[1;34;47m           [46m*[47m  [46m*[47m     [46m*[47m  [46m*[47m     [46m*[47m       [0m'
    tr '[20C[1;34;47m        [46m***[47m   [46m*[47m     [46m*[47m  [46m*[47m     [46m*[47m       [0m'
    tr '[20C[1;34;47m           [46m*[47m  [46m*[47m [41m [C[47m  [46m*[47m  [46m*[47m     [46m*[47m       [0m'
    tr '[20C[1;34;47m      [46m*****[47m    [46m*[41m [C[46m**[47m    [46m*****[47m        [0m'
  return
D6: /* 400 */
    tr '[0m[20C[47m      [1;32;42m*[47m   [42m*[47m    [42m*****[47m    [42m*****[47m        [0m'
    tr '[20C[1;32;47m      [42m*[47m   [42m*[47m   [42m*[47m     [42m*[47m  [42m*[47m     [42m*[47m       [0m'
    tr '[20C[1;32;47m      [42m******[47m  [42m*[47m     [42m*[47m  [42m*[47m     [42m*[47m       [0m'
    tr '[20C[1;32;47m          [42m*[47m   [42m*[47m [41m [C[47m  [42m*[47m  [42m*[47m     [42m*[47m       [0m'
    tr '[20C[1;32;47m          [42m*[47m    [42m*[41m [C[42m**[47m    [42m*****[47m        [0m'
  return
D7: /* 450 */
    tr '[0m[20C[47m      [1;33;43m*[47m   [43m*[47m    [43m*****[47m    [43m*****[47m        [0m'
    tr '[20C[1;33;47m      [43m*[47m   [43m*[47m   [43m*[47m        [43m*[47m     [43m*[47m       [0m'
    tr '[20C[1;33;47m      [43m******[47m   [43m*****[47m   [43m*[47m     [43m*[47m       [0m'
    tr '[20C[1;33;47m          [43m*[47m     [41m [C[47m  [43m*[47m  [43m*[47m     [43m*[47m       [0m'
    tr '[20C[1;33;47m          [43m*[47m    [43m*[41m [C[43m**[47m    [43m*****[47m        [0m'
  return
D8: /* 500 */
    tr '[0m[20C[47m      [1;36;44m*****[47m    [44m*****[47m    [44m*****[47m        [0m'
    tr '[20C[1;36;47m     [44m*[47m        [44m*[47m     [44m*[47m  [44m*[47m     [44m*[47m       [0m'
    tr '[20C[1;36;47m      [44m*****[47m   [44m*[47m     [44m*[47m  [44m*[47m     [44m*[47m       [0m'
    tr '[20C[1;36;47m           [44m*[47m  [44m*[47m [41m [C[47m  [44m*[47m  [44m*[47m     [44m*[47m       [0m'
    tr '[20C[1;36;47m      [44m*****[47m    [44m*[41m [C[44m**[47m    [44m*****[47m        [0m'
  return
D9: /* 600 */
    tr '[0m[20C[47m       [1;35;45m****[47m    [45m*****[47m    [45m*****[47m        [0m'
    tr '[20C[1;35;47m      [45m*[47m       [45m*[47m     [45m*[47m  [45m*[47m     [45m*[47m       [0m'
    tr '[20C[1;35;47m     [45m******[47m   [45m*[47m     [45m*[47m  [45m*[47m     [45m*[47m       [0m'
    tr '[20C[1;35;47m     [45m*[47m     [45m*[47m  [45m*[47m [41m [C[47m  [45m*[47m  [45m*[47m     [45m*[47m       [0m'
    tr '[20C[1;35;47m      [45m*****[47m    [45m*[41m [C[45m**[47m    [45m*****[47m        [0m'
  return
D10: /* 750 */
    tr '[0m[20C[47m      [1;34;46m******[47m   [46m*****[47m    [46m*****[47m        [0m'
    tr '[20C[1;34;47m           [46m*[47m  [46m*[47m        [46m*[47m     [46m*[47m       [0m'
    tr '[20C[1;34;47m          [46m*[47m    [46m*****[47m   [46m*[47m     [46m*[47m       [0m'
    tr '[20C[1;34;47m         [46m*[47m      [41m [C[47m  [46m*[47m  [46m*[47m     [46m*[47m       [0m'
    tr '[20C[1;34;47m        [46m*[47m      [46m*[41m [C[46m**[47m    [46m*****[47m        [0m'
  return
D11: /* 1000 */
    tr '[0m[20C[47m    [1;32;42m*[47m     [42m*****[47m    [42m*****[47m    [42m*****[47m    [0m'
    tr '[20C[1;32;47m   [42m**[47m    [42m*[47m     [42m*[47m  [42m*[47m     [42m*[47m  [42m*[47m     [42m*[47m   [0m'
    tr '[20C[1;32;47m    [42m*[47m    [42m*[47m     [42m*[47m  [42m*[47m     [42m*[47m  [42m*[47m     [42m*[47m   [0m'
    tr '[20C[1;32;47m    [42m*[47m    [42m*[47m     [42m*[41m [C[42m*[47m     [42m*[47m  [42m*[47m     [42m*[47m   [0m'
    tr '[20C[1;32;47m  [42m*****[47m   [42m*****[47m [41m [C[47m [42m*****[47m    [42m*****[47m    [0m'
  return
D12: /* Free Spin */
    tr '[0m[20C[47m  [1;33;43m******[47m  [43m*****[47m     [43m******[47m   [43m******[47m  [0m'
    tr '[20C[1;33;47m  [43m*[47m       [43m*[47m    [43m*[47m    [43m*[47m        [43m*[47m       [0m'
    tr '[20C[1;33;47m  [43m****[47m    [43m*****[47m     [43m****[47m     [43m****[47m    [0m'
    tr '[20C[1;33;47m  [43m*[47m       [43m*[47m    [43m*[41m [C[47m  [43m*[47m        [43m*[47m       [0m'
    tr '[20C[1;33;47m  [43m*[47m       [43m*[47m    [43m*[41m [C[47m  [43m******[47m   [43m******[47m  [0m'
  return
D13: /* Surprise */
    tr '[0m[20C[47m  [1;36;44m*[47m       [44m*[47m   [44m******[47m   [44m*[47m       [44m*[47m     [0m'
    tr '[20C[1;36;47m  [44m*[47m       [44m*[47m  [44m*[47m      [44m*[47m  [44m*[47m       [44m*[47m     [0m'
    tr '[20C[1;36;47m  [44m*[47m   [44m*[47m   [44m*[47m  [44m*[47m      [44m*[47m  [44m*[47m   [44m*[47m   [44m*[47m     [0m'
    tr '[20C[1;36;47m  [44m*[47m  [44m*[47m [44m*[47m  [44m*[47m  [44m*[47m  [41m [C[47m  [44m*[47m  [44m*[47m  [44m*[47m [44m*[47m  [44m*[47m     [0m'
    tr '[20C[1;36;47m   [44m**[47m   [44m**[47m    [44m**[41m [C[44m**[47m    [44m**[47m   [44m**[47m      [0m'
  return
D14: /* Lose Turn */
    tr '[0m[20C[47m  [1;35;45m*[47m       [45m*****[47m    [45m*****[47m   [45m******[47m    [0m'
    tr '[20C[1;35;47m  [45m*[47m      [45m*[47m     [45m*[47m  [45m*[47m        [45m*[47m         [0m'
    tr '[20C[1;35;47m  [45m*[47m      [45m*[47m     [45m*[47m   [45m*****[47m   [45m****[47m      [0m'
    tr '[20C[1;35;47m  [45m*[47m      [45m*[47m     [45m*[41m [C[47m      [45m*[47m  [45m*[47m         [0m'
    tr '[20C[1;35;47m  [45m*****[47m   [45m*****[47m [41m [C[47m [45m*****[47m   [45m******[47m    [0m'
  return
D15: /* Bankrupt */
    tr '[0m[20C[47m  [1;34;46m*****[47m    [46m****[47m   [46m*[47m      [46m*[47m  [46m*[47m    [46m**[47m  [0m'
    tr '[20C[1;34;47m  [46m*[47m    [46m*[47m  [46m*[47m    [46m*[47m  [46m***[47m    [46m*[47m  [46m*[47m  [46m**[47m    [0m'
    tr '[20C[1;34;47m  [46m*****[47m   [46m******[47m  [46m*[47m  [46m**[47m  [46m*[47m  [46m***[47m      [0m'
    tr '[20C[1;34;47m  [46m*[47m    [46m*[47m  [46m*[47m    [46m*[41m [C[46m*[47m    [46m***[47m  [46m*[47m  [46m**[47m    [0m'
    tr '[20C[1;34;47m  [46m*****[47m   [46m*[47m    [46m*[41m [C[46m*[47m      [46m*[47m  [46m*[47m    [46m**[47m  [0m'
  return
D16: /* Blank Wheel */
    tr '[0m[17C/[47m [30m.-------------------------------------. [37;40m\'
    tr '[16C/[47m  [30m|[1;40m[9CWritten By: Dotoran[9C[0;30;47m|  [37;40m\'
    tr '[16C[47m   [30m|[37C|   [0m'
    tr '[16C[30;47m   |[37C|   [0m'
    tr '[16C[30;47m   |[16C[41m [20C[47m|   [0m'
    tr '[16C\[47m  [30m|[16C[41m [20C[47m|  [37;40m/'
    tr "[17C\[47m [30m`----------------[41m  [C[47m------------------' [37;40m/"
    tr '[19C\[47m                [41m  [C[47m                  [40m/'
    tr '[21C\[47m              [41m  [C[47m                [40m/'
    tr '[23C\[47m            [41m   [C[47m             [40m/'
    tr '[25C\[47m          [41m   [C[47m           [40m/'
    tr '[27C\[47m        [41m   [C[47m         [40m/'
    tr '[29C\[47m      [41m    [C[47m      [40m/'
    tr '[31C\[47m    [41m    [C[47m    [40m/'
    tr '[33C\[47m  [41m    [C[47m  [40m/'
  return
D17: /* Rotating Wheel Routine */
    tr 'f1n1[33Cc9BANKRUPT' ; tr '[31Ccb300[6Cca750' ; tr '[29Cca250[10Ccb250'
    tr '[27Cc9600[14Ccc300' ; tr '[25Ccf400[18Ccd200' ; tr '[23Cce150[22Cce100'
    if wheel~=wheal then tr '[22Ccd200[24Ccf500' ; else tr '[22Ccd1000[23Ccf500'
    tr '[23Ccc250[22Cc9400' ; tr '[25Ccb400[18Cca300' ; tr '[27CcaLOSE[12CcbFREE'
    tr '[29Cc9450[10Ccc200' ; tr '[31Ccf150[6Ccd100' ; tr '[33CceSURPRISE'
    a=random(3,5) ; b=random(1,24)
    do i=1 to a ; do j=1 to 24 ; cc=cc+1 ; do slow ; end ; if cc>7 then cc=1
    c='c'word(colors,cc) ; s=word(spots,j) ; l=word(locs,j) ; tr '['l'H'c||s
    end j ; end i ; do i=1 to b-1 ; cc=cc+1 ; do slow ; end ; if cc>7 then cc=1
    c='c'word(colors,cc) ; s=word(spots,i) ; l=word(locs,i) ; tr '['l'H'c||s
    end i ; s=word(spots,b) ; l=word(locs,b) ; c=word(wheel,b)
    tr '['l'H<3r1cb c1 r0z4 cf's' z0r1c1 cb r0'
    if c<12 then tr '[8;36Hc2$ca's'n7'  ; if c=12 then tr '[8;34Hca's' SPINn7'
    if c=14 then tr '[8;34Hca's' TURNn7' ; if c=13 | c=15 then tr '[8;34Hca's'n7'
  return

TITLE:
    tr '[0m[10C[45m               [11C[1;31;46mo-------------------------------------o[0m'
    tr '[8C[1;31;45m    [11C    [9C[46m| [47m [0;34;47mR [46m [47m O [46m [31;42m===[46m [42m===[46m [47m [34mR [46m [47m T [46m [30;42m###[46m [42m###[46m [42m###[46m [1;31m|[0m'
    tr '[6C[1;31;45m    [37;40m[5CT H E[5C[45m    [7C[31;46m| [0;34;47mR R[46m [47mO O[46m [31;42m===[46m [42m===[46m [34;47mR R[46m [47mT T[46m [30;42m###[46m [42m###[46m [42m###[46m [1;31m|[0m'
    tr '    [1;31;45m    [19C    [5C[46m|                                     |[0m'
    tr '  [1;31;45m    [33;40m[7CW H E E L[7C[45m    [3C[31;46m| [47m [0;34;47mR [46m [31;42m===[46m [42m===[46m [42m===[46m [47m [34mO [46m [47m R [46m [31;42m===[46m [30;42m###[46m [42m###[46m [1;31m|[0m'
    tr ' [1;31;45m   [27C   [2C[46m| [0;34;47mR R[46m [31;42m===[46m [42m===[46m [42m===[46m [34;47mO O[46m [47mR R[46m [31;42m===[46m [30;42m###[46m [42m###[46m [1;31m|[0m'
    tr '  [1;31;45m [37;40m[13CO F[13C[45m [3C[31;46mo-------------------------------------o[0m'
    tr '  [1;31;45m [29C [0m'
    tr ' [1;31;45m   [33;40m[7CF O R T U N E[7C[45m   [40m[16CP E R S O N'
    tr '  [45m    [23C    [0m'
    tr '    [1;33;45m    [36;40m[5CV 6 . 0 b [4C[45m    [35;40m[9CCompletely ReWritten by [31mDotoran[35m!'
    tr '[6C[45m    [15C    [0m'
    tr '[8C[1;35;45m                   [37;40m[13CYour Hosts[31m: [32mPat Sajack [37m& [36mVanna[37m!!n1[0m'
  return

SYNTAX: ; ERROR: ; IOERR:
    tr 'n2ce*** c9BOOM ce*** c9Error Detectedce!' ; tr 'c6ERc9:cb'rc' c6(ca'errortext(rc)'c6) @ cf'sigl
    tr 'cdSysop has been notified...' ; bf ; changewhere oldwh
    call open(f1,dfile||'wof.errors',substr('wa',exists(dfile||'wof.errors')+1,1))
    call writeln(f1,'ANS Error: 'rc' ('errortext(rc)') in line 'sigl' ('date()')') ; call close(f1)
  signal QUIT2

/* Completed: November 26, 1993              Frontiers BBS (716)/823-9892 */
