IMD 1.18: 22/01/1996 8:23:56 micro cornucopia kaypro user group disk 29 games with source in turbo pascal     WORDS DAT29-DISK DOC& BACCARATCHN BACCARATPAS3 BJGAME CHN"BJGAME PASM !"BLACKBOXCHN#$%&BLACKBOXPAS@'()*+,-.BLOCK CHN/01BLOCK PASI23456789:;BOGGLE CHN <=BOGGLE PAS>?@ACHUCKLCKCHN BCCHUCKLCKPASDEFGCRC COMHIJCRCKLISTCRC KL 11o[p;l;;;hellopeoplerhythmepickleejokeree;sldreetoldreewpgg\eeereg\ee a;sldkfd;l ado[p;l;;;hellopeoplerhythmepickleejokeree;sldreetoldreewpgg\eeereg\ee a;sldkfd;l adD COMMNODODGE CHN*PQRSTUDODGE PAS`VWXYZ[\]^_`aGAMEMENUCHNbGAMEMENUPAS cdGAMES COM?efghijklGAMES PASmGUESSIT CHNnGUESSIT PASopqHANGMAN CHNrsHANGMAN PAS,tuvwxyHORSERACCHNz{|HORSERACPAS$}~KENO CHNKENO PAS#MAKEFILECHNMAKEFILEPAS READNUM PAS  This is a disk of games with source in Turbo Pascal. To play GAMES type "GAMES" after the A>. Turbo Pascal's "Chain" procedure allows you to chain to another program compiled as a .CHN file. Such a file contains only program code, and uses the Pascal library already present in memory (loaded with the first program - GAMES). GAMES chains to GAMEMENU which chains to the game you choose to play. At the end of the game it chains back to GAMEMENU. I wrote GAMEMENU so all the gaches the waiting object. If it hits head on, the ball is absorbed, if it passed between two objects separated by one space, the ball is reflected back to the source, if it is adjacent to an object on the edge, the ball is reflected back to the source, if it is diagonal to an object, the ball is reflected at a right angle to the original path. BLOCK.PAS This is a block letter producer.  immediately. An example of counting; dealt an ace and a six, the player has a total of seven; dealt a jack and a three, the player has a total of three; dealt a five and an eight, the player has a total of three (thirteen minus ten). BJGAME.PAS This is the time honored game of blackjack. This is a pretty rudimentary version of the game as splitting and doubling down are not allowed. Blackjace horses start the race. Each horse has a different handicap which is a distance to run. Two dice are rolled and the horse represented by the total of the dice may be moved one length, or the horses represented by each die may be moved one length. KENO.PAS This is a version of the Las Vegas gambling game KENO. You are allowed to choose 8 numbers from 1 to 80. The computer will select 20mes could be distributed in executable form without including the run time module with every game: thus saving 8K of disk space per program. These programs were put together by a beginning Pascal programmer and should help others new to Turbo. They function fairly well as games. Instructions are provided by each program, and a brief description of each follows. BACCARAT.PAS Baccarat is a card game popular in Europe. It is a high stakes g BOGGLE.PAS This is a version of the ever popular number guessing game mastermind. CHUCKLCK.PAS This is a dice rolling game. You pick a number and bet that at least one of three dice rolled will be that number. DODGE.PAS This is a dodge'em type game where you are being pursued by various meanies and your object is to avoid them or preferrably destroy them. ks are honored and pay double. Blackjack pushes are won by the house. The dealer plays on even if you bust and thus can also bust. This is a push (no bet). BLACKBOX.PAS This a game to guess where a hidden object (or objects) are in a black box. You do this by shooting balls into the box and observing where they exit (if they exit). This is affected by the way the ball enetering approa numbers in the same range. You win based on how many of your numbers the computer also selected. MAKEFILE.PAS This is the program to create the word file for HANGMAN.PAS. ambling game favored by the rich (us poor types can't afford it). The player and the bank get two cards each. Tens and face cards count 0, number cards count their value and aces count one. Each player totals his cards modulo 10 (anything over 10 is dropped) and the higher total wins. An additional card may be added if desired. A total of 8 or 9 on the initial two cards is called a "NATURAL" and wins  GUESSIT.PAS This is the simpliest game, guessing a number between 1 and 100. You are told if you are high or low. HANGMAN.PAS This a typical hangman program. It has a list of words (see MAKEFILE.PAS), selects one and then you guess the letters in the word. Seven incorrect guesses cause the man to be hanged. HORSERAC.PAS This is a rather complicated horse race game. A series of twelv  1!͍!)Ͳ&"*^#V"!+._b! *!߫͞*߫!aEV ŔPlease enter a number͐b**s#r*߫!NE!}2ث!!5z!"٫!:*٫+)*٫! !s!:*٫+)*ث&s!:*٫+)n&! NE *ث&!aE *ث&#}2ث !}2ث*٫#y !"z!!5z|!"ϫ!!"ͫ!:*ͫ+)ѫ!:*ͫ+)!:*ϫ+)!:*ϫ+)!ѫ*ϫ#!˫*˫&Rª!ŔAce bÄ"R!R!R!ʹbbŔ You have *2!͐bR͐bŔWant to try again? b!8!/b'! gamemenu.chn=!ŔThe player must take a card͐b!8"#R͐b*«&EP&*9&!ͯEM&ŔThe banker must take a card͐b!9"#Ç&ͅ#Eʇ&ŔThe banker must take a card͐b!9"#R͐bŔThe player's total is *8&!͐bŔThe banker's total is *9&!͐b!Y}2/!'"4!'"2g !"z*/&(!NaEʰ)*/&(Q!Pa!Ba}oEʕ'R͐bŔ)Do you want to be the banker, or player? b!8!/b#'R͐b*/&(!PNE'ŔBet? b!0*) compbank : boolean; (* whether the computer is the banker *) dummy : file; {$I readnum} (* * makedeck * create the deck *) procedure makedeck; var decknum : decktype; suit : suittype; value : 1..13; begin suit := hearts; for decknum := 1 to decksize do begin deck[decknum].value := decknum mod 13 + 1; deck[decknum].suit := suit; if deck[decknum].value = 13 then if suit <> spades then suit := sucR!R!R!R! R"*˫&R!́ bÄ" R3"ŔTen bÄ" RO"ŔJack bÄ" Rk"ŔQueenbÄ" R„"ŔKing bŔ of b*̫&Rµ"ŔHearts b#R"ŔDiamondsb#R"ŔClubs b#R#ŔSpades bŔ b$"!:*z+)}!!:*z+)n&! ͇Ex#*n&!:*z+)n&! *s*z!"z!:*z!R+)n&! tEʳ#!}2#!:*z!R+)n& (* * baccarat * plays the card game of baccarat *) program baccarat (input, output); const decksize = 416; (* size of 8 decks *) start = 10000; (* the amount of money you start with *) type suittype = (hearts,clubs,diamonds,spades); card = record value : 1..13; suit : suittype end; handvalue = 0..9; decktype = 1..decksize; stand = set of handvalue; var cardnum : decktype; (* current card we are playing *) deck (!'! "0*0! "0*0! "0Ŕ The bet is *0!͐b#*/&!bN*/&!BN}oEX(*8&}27*9&}26j(*9&}27*8&}26*9&*8&NEʑ(ŔTie͐b)*7&*6&͛E(ŔThe computer has won͐b*4*0"4*2*0R"2)Ŕ You won!!!b*4*0R"4*2*0"2R͐bŔ Totals are:͐bŔ Computer has *4!͐bŔ You have *2!͐bR͐bŔWant to try again? b!8!/b'! gamemenu.chn=!c(suit) else suit := hearts end end; (* * shuffle * go through the deck exchanging cards *) procedure shuffle; var tmp : card; decknum, newnum : decktype; begin cardnum := 1; for decknum := 1 to decksize do begin newnum := random(decksize) + 1; tmp := deck[newnum]; deck[newnum] := deck[decknum]; deck[decknum] := tmp end end; (* * showcard * prints out a card in a readable format *) procedure sh}2!}2*&R# R $*9&!tE$!}2$R/$*9&!tE,$!}2$RC$R_$*9&!NE\$!}2$Rs$R$*9&!tEʌ$!}2$Rʣ$R¿$*9&!tEʼ$!}2$R$*9&!tE$!}2*&!}2«!}29!}28*z!!R͛E%!Ŕ"Player's hand Banker's hand͐b!8"#!9"#R͐b!8"#!9"#R͐b*9&!t*8&!t}oEʱ%ŔNatural͐bÐ&*8&!͇E%!}2 : array [decktype] of card; (* the deck *) bankhand : handvalue; (* the banker's hand *) playhand : handvalue; (* the player's hand *) comphand : handvalue; (*value of the computer's hand *) humhand : handvalue; (* the value of the human's hand *) compmoney : integer; (* the computer's money *) hummoney : integer; (* the player's money *) bet : integer; (* the size of the bet *) ch : char; (* used to answer questions   owcard (display:card); begin case display.value of 1: write('Ace '); 2,3,4,5,6,7,8,9: write(display.value:1,' '); 10: write('Ten '); 11: write('Jack '); 12: write('Queen'); 13: write('King ') end; write(' of '); case display.suit of hearts : write('Hearts '); diamonds : write('Diamonds'); clubs : write('Clubs '); spades : write('Spades ') end; write(' ') end; (* * play * deal the cardnkhand) end; writeln end; writeln('The player''s total is ',playhand); writeln('The banker''s total is ',bankhand) end; (* Play *) begin ch := 'Y'; randomize; compmoney := start; hummoney := start; makedeck; cardnum := decksize; while upcase(ch) <> 'N' do begin while not (upcase(ch) in ['P','B']) do begin writeln; write('Do you want to be the banker, or player? '); read(trm,ch) end; w bankdeal := false; 1: if bankhand >= 4 then bankdeal := false end end; (* BankDeal *) begin (* Play *) stood := true; bankhand := 0; playhand := 0; if cardnum > (decksize - 7) then shuffle; writeln('Player''s hand Banker''s hand'); cardeal(playhand); cardeal(bankhand); writeln; cardeal(playhand); cardeal(bankhand); writeln; if (bankhand >= 8) or (playhand >= 8) then writeln('Natural')  hummoney := hummoney + bet end end; writeln; writeln('Totals are:'); writeln('Computer has ',compmoney); writeln('You have ',hummoney); writeln; write('Want to try again? '); read(trm,ch) end; assign(dummy,'gamemenu.chn'); chain(dummy) end. s, then decide if we need to ake any cards *) procedure play; var stood : boolean; (* if the player stood *) (* * cardeal * actually deals a card out *) procedure cardeal(var addto:handvalue); begin showcard(deck[cardnum]); if deck[cardnum].value <= 9 then addto := (addto + deck[cardnum].value) mod 10; cardnum := cardnum + 1 end; (* * bankdeal * decide if the bank should have a card dealt to it *) function bankdeal: boolean; var lastval : riteln; if upcase(ch) = 'P' then begin write('Bet? '); readint(bet) end else begin (* * the computer is the player so it makes a random bet *) bet := random(start) + 10; bet := bet div 10; bet := bet * 10; writeln('The bet is ',bet) end; play; randomize; if (ch = 'b') or (ch = 'B') then begin comphand := playhand; humhand := bank else begin if playhand <= 5 then begin stood := false; writeln('The player must take a card'); cardeal(playhand) end; writeln; if stood then begin if bankhand < 6 then begin writeln('The banker must take a card'); cardeal(bankhand) end end else if bankdeal then begin writeln('The banker must take a card'); cardeal(ba0..9; (* the value of the last card *) begin if deck[cardnum - 1].value >= 10 then lastval := 0 else lastval := deck[cardnum-1].value; bankdeal := true; case lastval of 0,9: if bankhand >= 4 then bankdeal := false; 8: if bankhand >= 3 then bankdeal := false; 7,6: if bankhand = 7 then bankdeal := false; 5,4: if bankhand >= 6 then bankdeal := false; 3,2: if bankhand >= 5 then hand end else begin comphand := bankhand; humhand := playhand end; if bankhand = playhand then writeln('Tie') else begin if comphand > humhand then begin writeln('The computer has won'); compmoney := compmoney + bet; hummoney := hummoney - bet end else begin write('You won!!!'); compmoney := compmoney - bet;   1!͍!0BͲ60"*^#V"!+._b! *!߭͞*߭!aEV ŔPlease enter a number͐b**s#r*߭!NEܭŔthe !l*ݭ&)]T) !qbŔ of !*ܭ&))) !q͐bR! e.!q́Blackjack for one͐bŔDo you want instructions? b!8!ӭbR͐b*ӭ&(!YNE!Ŕ9This program plays a simple version of blackjack. Neither͐bŔ9splitting, nor modification of the bet after the hand has!!́ and !!͐bŔ8and must be no larger than the amount of money you have.͐bŔEnter 0 to leave.͐bŔ-Size of bet (0 to end, cr for same as last)? b!0s)*0!NE*ŔYou have quit with $*2!!.͐b! gamemenu.chn=!ʹb!C!+)! '+)!4!+)! '+)!C!+)! '+)!4!+)! '+)Ŕ You drew b!C!+)g Ŕand b!C!+)g R͐+)!!"!!5zʠ&}2!! 5zʕ&}2!*+)"*&*s**&s!*+)!C!!*+)!4!}o}oEʊ&*!s*!"*&#&*&#%!".*!R"ޮŔ*** *ޮ!́ cards left.͐b!*ޮ5z '"**ޮ͇"}%*#&*ޮ!ͯE<'ŔReshuffling ...͐bz%*.!".!*.+)!s*ޮ!R"ޮ*."*y!"q!"o!!5z$("s!y*s+)n&!NE(́ You lose.͐b*2*0R"20ŔYou win͐b*2*0"2Ŕ You now have $*2!͐b"z%5)c*!Co(}oEX0,\-.!C͢"!4͢"*2!͇E<0ŔYou have run out of money.͐b! gamemenu.chn=!ʹbC͐bŔbeen dealt is allowed.͐bR͐bϭ!}2ҭ!!5zʁ""*ϭ&!*+)n&N*Э&!*+)n&N}oEx"!}2ҭ*#$"*ҭ&"!*"*"!!5z""**+)!s*#õ" !C͢"!4͢"!d"2!"ޮ!"!!5zE#}2!R*&)*s#r*!"*&##! ! 5zz#}2!R*&)! s#r*&#P#!R! )! s#r!l!)]T)two!l!)]T)three!lbŔThe dealer's up card is b!4!+)g !"M!y}2L*M!͇!Cz'!ͯ}o*L&(!YN}oE-ŔYour count is !Cz'!͐bŔHit? b!8!LbR͐b*L&(!YNE-!C*M+)! '+)Ŕ You drew b!C*M+)g *M!"M,!Cz'!ͯ*M!͛}oE[-ŔYou can take only !!́ cards.͐bR͐bŔDealer's hole card is b!4!+)g !"F*F!͇!4z'!ͯ}oE.!4*F+!y*s+)"u*un&! NE'*o!"o*q!R*un&)^#V"q*s#Þ'*o!͛*q!͛}oEe(*o!R"o*q! R"q$(*q"*_!R!_!+)n&)^#V! N!R!_!+)n&)^#V! N}o!R!_!+)n&)^#V! N!R!_!+)n&)^#V! N}o}o}2n*n&Ŕ-Size of bet (0 to end, cr for same as last)? b!0*0Q!a!!k}o*0*2͛}oEʐ*ŔA bet must be between bR!)]T)four!l!)]T)five!l!)]T)six!l!)]T)seven!l!)]T)eight!l!)]T)nine!l!)]T)ten!l! )]T)jack!l! )]T)queen!l! )]T)king!l! )]T)ace!!)))diamonds!!)))spades!!)))hearts!!)))clubs%""!*+)!*+)!*+)!*)! '+)Ŕ Dealer drew b!4*F+)g *F!"FÝ-R͐bŔ Dealer has !4z'!!.͐b!4o(Eʐ.ŔDealer got a blackjack.b*2*0R"20!Co(E.ŔYour blackjack wins!b*2*0!"20!Cz'!͛EK/Ŕ You busted.b!4z'!͛E9/Ŕ So did the dealer. No payout.bH/*2*0R"20!4z'!͛Eʅ/Ŕ Dealer busts.b*2*0"20!4z'!Cz'NEʯ/ŔPush.b0!4z'!Cz'͛E/R  program bjgame; const decksize = 52; maxhandsize = 5; mincards = 5; dealerstays = 17; busted = 21; startamount = 100; minbet = 2; maxbet = 200; type cardsuit = (spades, hearts, clubs, diamonds); cardvalue = (duece, three, four, five, six, seven, eight, nine, ten, jack, queen, king, ace); cardstate = (picked, indeck); card = record suit : cardsuit; value : cardvalue; state : cnstructions; clearhand(player); clearhand(dealer); money := startamount; cardsleft := 0; i := 2; for cardval := duece to ten do begin countvalue[cardval] := i; i := i + 1; end; for cardval := jack to king do countvalue[cardval] := 10; countvalue[ace] := 11; valuename[duece] := 'two'; valuename[three] := 'three'; valuename[four] := 'four'; valuename[five] := 'five'; valuename[six] := 'six'; valuename[seven] := 'sting, nor modification of the bet after the hand has'); writeln('been dealt is allowed.'); end; writeln; end; (* * returns true if the card c is in the hand *) function inhand(c: card; whose: hand): boolean; var handindex : integer; begin inhand := false; for handindex := 1 to maxhandsize do if ((c.suit = whose[handindex].suit) and (c.value = whose[handindex].value)) then begin inhand := true; end; end; (* *  begin suit := asuit; value := avalue; if not (inhand(deck[i], player) or inhand(deck[i], dealer)) then begin state := indeck; i := i + 1; end; end; curcard := 0; cardsleft := i - 1; writeln('*** ',cardsleft:1,' cards left.'); for i := 1 to cardsleft do swapcard(i, randcard(cardsleft)); end; (* * returns the index into the deck of the next card. calls shuffle if deck * is nearly finisheardstate; end; hand = array [1..maxhandsize] of card; var deck : array[1..decksize] of card; cardsleft : integer; suitname : array[cardsuit] of string[8]; valuename : array[cardvalue] of string[5]; countvalue : array[cardvalue] of integer; player : hand; dealer : hand; money : integer; bet : integer; curcard : integer; dummy : file; {$i readnum} (* * write the suit and value of aeven'; valuename[eight] := 'eight'; valuename[nine] := 'nine'; valuename[ten] := 'ten'; valuename[jack] := 'jack'; valuename[queen] := 'queen'; valuename[king] := 'king'; valuename[ace] := 'ace'; suitname[diamonds] := 'diamonds'; suitname[spades] := 'spades'; suitname[hearts] := 'hearts'; suitname[clubs] := 'clubs'; randomize; end; (* * shuffles the cards that are not in either player's hand. the initial shuffle * does all the cards becaureturns a random index into the deck *) function randcard(l: integer) : integer; begin randcard := 1 + random(l); end; (* * removes all cards from the argument hand *) procedure clearhand(var ahand: hand); var handindex : integer; begin for handindex := 1 to maxhandsize do ahand[handindex].state := indeck; end; (* * initialize the names of the suits and values *) procedure initialize; var i : integer; cardval : cardvalue; begin id. *) function pickcard : integer; begin if cardsleft < mincards then begin writeln('Reshuffling ...'); shuffle; end; curcard := curcard + 1; deck[curcard].state := picked; cardsleft := cardsleft - 1; pickcard := curcard; end; (* * determines the sum of the values in a hand. a card's state must be * 'picked' for it to be included. aces are assumed to be 11. if the * count is over 21 and there are aces in it, as many as are needed * will b card *) procedure printcard(acard: card); begin write('the ',valuename[acard.value]); writeln(' of ',suitname[acard.suit]); end; (* * asks for intructions *) procedure instructions; var response : char; begin writeln(' ':15,'Blackjack for one'); write('Do you want instructions? '); read(trm,response); writeln; if upcase(response) = 'Y' then begin writeln('This program plays a simple version of blackjack. Neither'); writeln('splitse both hands start empty. *) procedure shuffle; var asuit : cardsuit; avalue : cardvalue; i : integer; (* * exchange the cards at the two positions in the deck *) procedure swapcard(first, second : integer); var tempcard : card; begin tempcard := deck[first]; deck[first] := deck[second]; deck[second] := tempcard; end; begin i := 1; for asuit := spades to diamonds do for avalue := duece to ace do with deck[i] do   e devalued to 1. *) function countcards(someone: hand): integer; var handindex, sum, numaces : integer; begin sum := 0; numaces := 0; for handindex := 1 to maxhandsize do if someone[handindex].state = picked then with someone[handindex] do begin if value = ace then numaces := numaces +1; sum := sum + countvalue[value]; end; while (numaces > 0) and (sum > busted) do begin numaces := numaces - 1 atcard := atcard + 1; end; end; (* while *) if (countcards(player) < busted) and (atcard > maxhandsize) then writeln('You can take only ',maxhandsize:1,' cards.'); end; (* PlayerTakes *) procedure dealertakes; var atcard : integer; begin writeln; write('Dealer''s hole card is '); printcard(dealer[1]); atcard := 3; while (atcard <= maxhandsize) and (countcards(dealer) < dealerstays) do begin dealer[atcard] := deck[pickcard chain(dummy) end; end; (* * deals the cards to both participants for this hand *) procedure dealhands; begin player[1] := deck[pickcard]; dealer[1] := deck[pickcard]; player[2] := deck[pickcard]; dealer[2] := deck[pickcard]; write('You drew '); printcard(player[1]); write('and '); printcard(player[2]); writeln; write('The dealer''s up card is '); printcard(dealer[2]); end; (* * asks the player if more cards are wanted. *) procedure money - bet end else begin writeln('You win'); money := money + bet; end; writeln(' You now have $',money:1); end; (* main program *) begin initialize; shuffle; repeat getbet; clrscr; dealhands; if not blackjack(player) then playertakes; dealertakes; whowon; clearhand(player); clearhand(dealer); until money <= 0; writeln('You have run out of money.'); assign(dummy,'gameme; sum := sum - 10; end; countcards := sum; end; (* * returns true if the argument hand is a blackjack *) function blackjack(someone: hand): boolean; begin blackjack := ((countvalue[someone[1].value] = 10) and (countvalue[someone[2].value] = 11)) or ((countvalue[someone[1].value] = 11) and (countvalue[someone[2].value] = 10)); end; procedure getbet; const betprompt = 'Size of bet (0 to end, cr for same as last]; write('Dealer drew '); printcard(dealer[atcard]); atcard := atcard + 1; end; end; procedure whowon; begin writeln; writeln('Dealer has ',countcards(dealer):1,'.'); if blackjack(dealer) then begin write('Dealer got a blackjack.'); money := money - bet; end else if blackjack(player) then begin write('Your blackjack wins!'); money := money + (bet * 2) end else if countcards(player) > busted then  playertakes; var atcard : integer; answer : char; begin atcard := 3; answer := 'y'; while (atcard <= maxhandsize) and (countcards(player) < busted) and (upcase(answer) = 'Y') do begin writeln('Your count is ',countcards(player)); write('Hit? '); read(trm,answer); writeln; if upcase(answer) = 'Y' then begin player[atcard] := deck[pickcard]; write('You drew '); printcard(player[atcard]); nu.chn'); chain(dummy); end. )? '; begin write(betprompt); readint(bet); while not (bet in [0,minbet..maxbet]) or (bet > money) do begin write('A bet must be between '); writeln(minbet:1,' and ',maxbet:1); writeln('and must be no larger than the amount of money you have.'); writeln('Enter 0 to leave.'); write(betprompt); readint(bet); end; if bet = 0 then begin writeln('You have quit with $',money:1,'.'); assign(dummy,'gamemenu.chn');  begin write('You busted.'); if countcards(dealer) > busted then write(' So did the dealer. No payout.') else money := money - bet; end else if countcards(dealer) > busted then begin write('Dealer busts.'); money := money + bet; end else if countcards(dealer) = countcards(player) then write('Push.') else if countcards(dealer) > countcards(player) then begin writeln('You lose.'); money :=  1!͍!,|Ͳe,"*^#V"Ǯ!ɮ+._b!ɮ *!Ů͞*Ů!aEV ŔPlease enter a number͐b*Ǯ*s#r*Ů!NEÎ$*&!N*&!N}oE !*&!R)))*&n&!*&!)))*&n&}o}21!!*&)))*&!Rn&!*&)))*&!n&}o}2*&*&Rj!*î&!R!!N}2"R¢!*î&!R!!!RN}2"R!*î&!R!!Nld I shoot now? b!*Q!! k}oE^*Ŕ&Sorry, but only numbers between 0 and ! !͐bŔ Start where? b!)*!aE*Ŕin at *!! b!}2!'*g }2*&!NE*ŔAbsorbed͐b*ŔIt came out at *&)!͐b*!NEʸ)Ŕ 32 31 30 29 28 27 26 25͐bŔ -------------------------͐b!!5z,}2}*}&R!!(b!!5z+}2|!*}&)))*|&n&E+Ŕ* î#*î&g }2Į& "E;&*&R%R &!}2$&R&R$&!}2!î#*î&g }2Į& #Eʗ&*&R[&Re&!}2À&Ry&R€&!}2!î#*î&g }2Į&7!}oEʺ&!î#*î&g }2Į&*î&}2Į*Į&!! 5z)'}2!! 5z'}2!*&)))*&!s*&#&*&#&&R͐bŔHow many balls? b!!"**ͯE'!!}2!!}2!*&)))*&n&}oE'!*&)))(* * blackbox * try to determine the location of n balls in a black box *) program blackbox(input, output); const side = 8; (* there are 8 squares to a side *) siden1 = 9; (* the length of one side plus one *) maxstart = 32; (* maximum possible location for ray *) absorbed = 0; (* what track returns when ray absorbed *) boxsize = 64; (* size of the box *) type course = (up,down,left,right); (* possible directions for rays *) lines }2"R"*î&!R!!!RN}2*&*&RO"!*&!R)))*&!Rn&}2#R‹"!*&!R)))*&!n&}2#R"!*&!R)))*&!Rn&}2#R#!*&!)))*&!Rn&}2*&*&RI#!*&!)))*&!Rn&}2#R‚#!*&!)))*&!n&}2#R¾#!*&!R)))*&!n&}2#R#!b+Ŕ. b*|&#Ô+R!)!*}&R!͐b*}&#g+Ŕ -------------------------͐bŔ 9 10 11 12 13 14 15 16͐b&+*''+! gamemenu.chn=!ʹbŔ -------------------------͐bŔ 9 *&!s*!"c'ø)"*^#V!aE)*^#V!͇EJ(!}2*^#V!R!!*s#r)*^#V!!͇Eʙ(!}2!!!*^#VRR*s#r)*^#V!!͇E(!}2!!*^#VR!!*s#r)!}2!!*^#VR!*s#r}2*&RJ)*&!!}2ò)Rw)*&!!R!}2ò)R–)!!*&R}2ò)R²)*&!0R}2*&ŔWhere shou = array[0..siden1] of boolean; (* possible locations in the box *) location = 0..boxsize; (* 0 is for absorption *) var box : array[0..siden1] of lines; (* the black box *) direction : course; (* the ray's current direction *) startray : 1..maxstart; (* the ray's starting location *) numballs : integer; (* the number of balls *) dummy : file; {$I readnum } (* * track * recursive functi*&!)))*&!n&}2*&"7!}oEʍ$*&R3$*n&!R*sÍ$RQ$*n&!*sÍ$Rr$*n&!R*sÍ$R$*n&!*s}2î*î&!R!!}2*î&!R!!}2!*&)))*&n&E%!}2Į&j Eg%*&R"%!}2[%R6%!}2[%RJ%!}2[%R[%!}2*î&}2Į& " #}oE%*&R%!}2%R£%!}2%R·%!}2%R%!}2!  on that follows a ray's course through the box *) function track(place:location):location; var rownum : 1..side; colnum : 1..side; (* * onside * tests to see if there is a ball on either side of a ray *) function onside:boolean; begin if (direction = right) or (direction = left) then onside := box[rownum-1][colnum] or box[rownum+1][colnum] else onside := box[rownum][colnum-1] or box[rownum][colnum+1] end; (* * edge * tests if a ray has reached the up : direction := down; down : direction := up end; change(place); track := track(place) end else begin if diagup then begin case direction of left, right : direction := down; up,down : direction := right end; change(place); track := track(place) end else  * change * moves the ray one square in the current direction *) procedure change(var num:location); begin (* if we are on an edge, then don't move *) if not edge then case direction of left : num := num - 1; right: num := num + 1; up : num := num - side; down : num := num + side end end; (* * track *) begin rownum := (place - 1) div side + 1; colnum := (place - 1) mod side + 1; if box[rownum][colnum] then e('How many balls? '); readint(numballs); randomize; placed := 0; while placed < numballs do begin i := 1 + random(side); j := 1 + random(side); if not box[i][j] then begin box[i][j] := true; placed := placed + 1 end end end; (* * getray * sits in a loop getting numbers from the user, and using them to determine * where to fire a ray. if the number is 0, then the user is read to guess * where the balls are located.  end of the box *) function edge:boolean; begin case direction of left : edge := ( (place - 1) mod side ) = 0; right: edge := ( (place - 1) mod side ) = side - 1; up : edge := ( (place - 1) div side ) = 0; down : edge := ( (place - 1) div side ) = side - 1 end end; (* * diagup * tells me if there is a ball on the upward diagonal *) function diagup:boolean; begin case direction of left : diagup := box[rownum-1][colnum-1]; right:  if diagdown then begin case direction of left,right : direction := up; up,down : direction := left end; change(place); track := track(place) end else if not edge then begin change(place); track := track(place) end else track := place end end track := absorbed else begin if onside then begin case direction of left : direction := right; right: direction := left; up : direction := down; down : direction := up end; track := place end else begin if diagup and diagdown then begin case direction of left : direction := right; right: direction := left; *) procedure getray; var raynum : integer; outat : location; (* * raytobox * converts a user number into the equivalent location in the box *) procedure raytobox(var num : integer); begin if num <> 0 then begin if num <= side then begin direction := right; num := (num-1)*side + 1 end else if num <= (side + side) then begin direction := up; num := sqr(side) - ((2*side)-num) end diagup := box[rownum-1][colnum+1]; up : diagup := box[rownum-1][colnum-1]; down : diagup := box[rownum+1][colnum-1] end end; (* * diagdown * tells me if there is a ball on the diagonal downward *) function diagdown:boolean; begin case direction of left : diagdown := box[rownum+1][colnum-1]; right: diagdown := box[rownum+1][colnum+1]; up : diagdown := box[rownum-1][colnum+1]; down : diagdown := box[rownum+1][colnum+1] end end; (*  end end; (* * clearballs * removes all the balls from the box *) procedure clearballs; var i,j : 0..siden1; begin for i := 0 to siden1 do for j := 0 to siden1 do box[i][j] := false end; (* * placeballs * asks the user for the number of balls to place in the box, then * randomly places the balls in the box *) procedure placeballs; var i,j : 0..siden1; placed : integer; begin randomize; clearballs; writeln; writ   else if num <= (3 * side) then begin direction := left; num := (3 * side - num + 1) * side end else begin direction := down; num := (4 * side - num + 1) end end end; (* RayToBox *) (* * boxtoray * returns the ray location of an edge *) function boxtoray(place:location):location; begin case direction of right : boxtoray := place div side + 17; left : boxtoray := (place + (side-1)) dë!*{&Rb*{&!VNE!*(&!}2&"*(&}2&*(&!*&&R5z@"}2'R! b*'&#"*{&R͐b*(&#Ë!!! ͙!Ez#}2!*!&!R!Ezʻ"}2 R! b* &+Ú"*{&Rb!*!&R*!&Ez#}2 R! b* &+"*{&R͐b*!&+z"!!! ͧ5zʸ#}2*{&Rb*&!R!!!R5zʜ#}2R! b*&#{#*{&R͐b*&#<#!!); for j := 1 to side do if box[i][j] then write('* ') else write('. '); writeln(')',25-i) end; writeln(' -------------------------'); writeln(' 9 10 11 12 13 14 15 16') end; begin clearballs; printballs; placeballs; getray; printballs; assign(dummy,'gamemenu.chn'); chain(dummy) end.      )JR( )KR(#)LR2( )MRF(!R$)NRV(&)ORx('!'!'!'!'!)PRš('!'! )QR¼('!'!'!'! )RR('!'!'!'!'!)SR)  )TR")      )URD)'!'!'!'!'!'!)VR`)'!'!'!'!n!)WRt)!R$)XR‡)n!]")YR£)n!    )ZR¹)e )ŔI don't kiv side; up : boxtoray := 33 - place; down : boxtoray := place - 48 end end; (* BoxToRay *) begin (* GetRay *) repeat write('Where should I shoot now? '); readint(raynum); while not (raynum in [0..maxstart]) do begin writeln('Sorry, but only numbers between 0 and ',maxstart); write('Start where? '); readint(raynum) end; if raynum <> 0 then begin write('in at ',raynum:2,' '); ou ͙!EzQ$}2*{&Rb*&!R!!!R5z5$}2R! b*&#$*{&R͐b*&+#}2*&Eʄ$!"!}2!!}2à$!"!!}2!}2'!*&*&aE&*{&Rb!*&5z$}2R! b*&#$*{&Rb*&!!aEʰ%*&*&!!RJ}2*&!͛Eq%R! b*&!R}2>%*{&Rb!*&5zʭ%}2R! b*&#Ì%%!*&5z%}2R1!͍!*Ͳ)!!5z }2F*{&Rb*F&#R͐b!!!5zS }2AR! b*A&#2 *{&R͐b!!5z }2stop do begin write(ch); for j := 2 to i do write(' '); write(ch); if i<>(length div 2) then begin j := abs(i + i + 2 - length); while j>0 do begin write(' '); j := j - 1 end; write(ch); for j := 2 to i do write(' '); end else for j := 3 to i do write(' ');; writeln(ch); i := i + by  downto 1 do write(' '); write(ch); for j := length - i downto i do write(' '); writeln(ch) end; end; (* botv *) (* * what follows here are the special case * letters. They must be drawn by themselves. *) (* * drawk * draw a k *) procedure drawk; var i,j : 0..length; begin for i := 1 to trunc(length / 2) do begin write(ch); for j := i-1 to (length div 2) -1 do write(' '); writeln(ch) end;  line; side; side; side; side; side; line end; 'D' : begin line; twoside; twoside; twoside; twoside; twoside; line end; 'E' : begin line; side; s a line on the far side *) procedure farside; var i : 1..length; begin for i := 1 to length -1 do write(' '); writeln(ch) end; (* farside *) (* * twoside * draw a '* *' *) procedure twoside; var index : 1..length; begin write(ch); for index := 2 to length -1 do write(' '); side end; (* twoside *) (* * topv * draw a V on the top of the letter * used for x, y and v *) procedure topv; var i,j : 0..length; d : end; twoside; end; (* drawmw *) (* * drawn * draw an n *) procedure drawn; var i,j : 0..length; begin for i := 1 to length do begin write(ch); for j := 2 to length -1 do begin if j = i then write(ch) else write(' ') end; writeln(ch) end end; (* drawn *) (* * draw * case statement which calls the * needed routines for each character *) procedure draw; begin write  ide; line; side; side; line end; 'F' : begin line; side; side; line; side; side; side end; 'G' : begin line; side; side; twoside; twoside;  side; line; farside; farside; line end; 'T' : begin line; midline; midline; midline; midline; midline; midline end; 'U' : begin twoside; twoside; twoside; twosidue); 'N' : drawn; 'O' : begin line; twoside; twoside; twoside; twoside; twoside; line end; 'P' : begin line; twoside; twoside; line; side; side; side end; 'Q' : begin  writeln end; assign(dummy,'gamemenu.chn'); chain(dummy) end. (* block *)  twoside; line end; 'H' : begin twoside; twoside; twoside; line; twoside; twoside; twoside end; 'I' : begin line; midline; midline; midline; midline; midline; line e; twoside; twoside; line end; 'V' : begin twoside; twoside; twoside; twoside; topv end; 'W' : drawmw(false); 'X' : begin topv; botv end; 'Y' : begin topv; midline; midline;  line; twoside; twoside; twoside; twoside; line; farside end; 'R' : begin line; twoside; twoside; line; twoside; twoside; twoside end; 'S' : begin line; side;  end; 'J' : begin farside; farside; farside; farside; farside; farside; line end; 'K' : drawk; 'L' : begin side; side; side; side; side; side; line; end; 'M' : drawmw(tr midline; midline end; 'Z' : begin line; backdiag; line end; else writeln('I don''t know that character'); end; end; (* draw *) (* main program *) begin writeln; while ch <> ^m do begin writeln('Input a character to enlarge (cr to end) '); read(trm,ch); ch := upcase(ch); writeln; draw;   1!͍!.&-ͲÞ$!!5z# }2>!w*>&+!0! s*>&#!}2u!}2vŔ Your guess? b!5+._b!5 m!N}24!}23*4&*3&!͇}oE !5*3&n&Q!0!9k}24*3&!}23u *4&}oE ŔIllegal input, try again͐b$ X"Q!1!!5zʁ!}23!w*3&+n&!5*3&n&NEv!!1-Q*3&a!1*u&!}2u*3&#!!!5zX"}23!}22*2&!͇EM"!5*3&n&!w*2&+*) procedure create; var i : 1..numdigits; (* index variable *) begin for i := 1 to numdigits do number[i] := chr(ord('0') + random(10)) end; (* create *) (* * play * gets a number from the player * then figures out how many white, * and black numbers he (she) has. *) procedure play; const indexlength = 5; (* length of the indices *) var user : string[4]; (* input from player *) notbad : boolean; (* used to test foare to try again? b!8!{bR͐b*{&(!YaE$!C gamemenu.chn=!Cʹbses.͐bR͐bŔC used := used + [j]; j := numdigits end; j := j + 1 end (* while *) end (* for *) end (* else notbad *) end; (* play *) (* * inst * print out the instructions *) procedure inst; begin writeln('Boggle'); writeln; writeln('A version of mastermind.'); writeln('I guess a number, then you attempt to'); writeln('find out what the number is. When'); writeln('you make a guess, I will tell you hn&N*3&*2&a}o*2&!1-}o}oE;"*v&!}2v!1-Q*2&a!1!}22*2&!}22Ý!*3&#Ì!ŔBoggle͐bR͐bŔA version of mastermind.͐bŔ%I guess a number, then you attempt to͐bŔ!find out what the number is. When͐bŔ%you make a guess, I will tell you how͐bŔ%many digits were correct and in their͐bŔ#correct location (White numbers). I͐bŔ'will also tell you how many digits were͐bŔ r garbage *) i,j : 1..indexlength; (* index variables *) used : set of 1..numdigits; (* whether the digit has been used *) begin numwhite := 0; numblack := 0; write('Your guess? '); readln(user); notbad := length(user) = numdigits; i := 1; while notbad and (i <= numdigits) do begin notbad := user[i] in ['0'..'9']; i := i + 1 end; if not notbad then begin writeln('Illegal input, try again'); play end program boggle(input,output); const numdigits = 4; (* the number of digits in the number *) var ch : char; (* used to answer questions *) number : array[1..numdigits] of char; (* the actual number *) numblack, (* number of correct digits *) numwhite: 0..numdigits; (* number of correct and ordered digits *) numguess: integer; (* number of guesses taken *) dummy : file; (* * create * create a random number ow'); writeln('many digits were correct and in their'); writeln('correct location (White numbers). I'); writeln('will also tell you how many digits were'); writeln('correct, but in the wrong place.'); writeln; writeln('For example, is the number is 1234, and'); writeln('you guess 1467, then you would have'); writeln('1 white (the 1) and 1 black number (the 4),'); writeln end; (* inst *) begin write('Do you want instructions? '); read(trm,ch); writeln; correct, but in the wrong place.͐bR͐bŔ'For example, is the number is 1234, and͐bŔ#you guess 1467, then you would have͐bŔ+1 white (the 1) and 1 black number (the 4),͐bR͐bŔDo you want instructions? b!8!{bR͐b*{&(!YNE$Y"!}2u!}2v!"s*u&!aEk%$ ŔWhite = *u&!́ Black = *v&!͐b*s!"s %R͐bŔCorrect͐bŔ It took you *s!́ guesses.͐bR͐bŔC else (* notbad *) begin used := []; for i := 1 to numdigits do if number[i] = user[i] then begin used := used + [i]; numwhite := numwhite + 1 end; for i := 1 to numdigits do begin j := 1; while j <= numdigits do begin if (user[i] = number [j]) and (i<>j) and not (j in used) then begin numblack := numblack + 1;    if upcase(ch)='Y' then inst; repeat randomize; create; numwhite := 0; numblack := 0; numguess := 0; while numwhite <> numdigits do begin play; writeln('White = ',numwhite,' Black = ',numblack); numguess := numguess + 1 end; writeln; writeln('Correct'); writeln('It took you ',numguess,' guesses.'); writeln; write('Care to try again? '); read(trm,ch); writeln;E5"Ŕonly numbers between *̮!́ and *ʮ!́ are allowed.͐b!ή *̮*ʮ́!";"*Į"*!!}2*&R!́ b*&"®*®!"zŔWant instructions? b!8!vbR͐b*v&(!YNE"g R͐bŔ You have $*z!͐bHow large a bet? !*ź!"xPick a number !!́!}2w!}2tŔDie1 Die2 Die3͐b!!5zʜ#}2u?"*w&NEʑ#*t&!}2t*u&#f#R͐b*t&!NE#Ŕ You won $*xie; (* number of matched dice *) dummy : file; {$I readnum } (* * inst * prints out instructions *) procedure inst; begin writeln('Chuck-a-luck'); writeln; writeln('You choose a number between 1 and 6.'); writeln('I roll three dice, if you match 1, you'); writeln('get even money. If you match 2 dice,'); writeln('you get double your bet, if you match all'); writeln('three, you get triple.'); writeln end; (* inst *) (* * getnum * ask a ques until upcase(ch) <> 'Y'; assign(dummy,'gamemenu.chn'); chain(dummy) end. (* boggle *) (* * chuckaluck * you choose a number between 1 and 6. * I roll three dice, if you match 1, you * get even money. If you match 2 dice, * you get double, if you match all three, * you get triple. *) program chuckaluck(input,output); const startmoney = 1000; (* amount of money you start with *) maxdie = 6; (* maximum value of a die *) mindie = 1; (* minimum value of a die *) numdie = 3; (* number of dice *) payoff!!͐b*z*x!"z$*t&!NEG$Ŕ you won $*x!!͐b*z*x!"z$*t&!NEʘ$Ŕ You won $*x!!͐b*z*x!"z$Ŕ You lost $*x!͐b*z*xR"z*z!͛E%ŔCare to try your luck again? b!8!vbR͐b*z!͇*v&(!Ya}oE"ŔYou leave with $*z!͐b!D gamemenu.chn=!DʹbvbR͐b*z!͇*v&(!Ya}oE"ŔYou letion from the player, * and get a number between min and * max with error checking *) function getnum(question:str80;min,max:integer):integer; var inter : integer; (* intermediate result *) begin write(question); readint(inter); if (inter < min) or (inter > max) then begin writeln('only numbers between ',min,' and ',max,' are allowed.'); getnum := getnum(question,min,max) end else getnum := inter end; (* getnum *) (* * rolldie *1!͍!%Ͳv""B*B^#V"'!)+._b!) *B!%͞*%!aEV ŔPlease enter a number͐b*'*Bs#r*%!NEŔ Chuck-a-luck͐bR͐bŔ$You choose a number between 1 and 6.͐bŔ&I roll three dice, if you match 1, you͐bŔ$get even money. If you match 2 dice,͐bŔ)you get double your bet, if you match all͐bŔthree, you get triple.͐bR͐b"ʮ"̮P!ήͲ!ή R!qb!Į*Į*̮ͯ*Į*ʮ͛}o1 = 1; (* pay off even money on 1 match *) payoff2 = 2; (* pay off double on two *) payoff3 = 3; (* pay off triple on three *) type str80 = string[80]; var money : integer; (* the amount of money you have *) bet : integer; (* amount you bet *) guess : mindie..maxdie; (* the die you guess *) ch : char; (* used for input *) eachdie: 1..numdie; (* index used to roll die *) matched: 0..numd   roll a die and print out its * value. *) function rolldie: integer; var dievalue : mindie..maxdie; begin randomize; dievalue := mindie + random(maxdie); write(dievalue:4,' '); rolldie := dievalue end; (* rolldie *) begin money := startmoney; write('Want instructions? '); read(trm,ch); writeln; if upcase(ch) = 'Y' then inst; repeat writeln; writeln('You have $',money); bet := getnum('How large a bet? ',1,money); th file - ! ~T #M M 2 2 2 2 ! >2 3o: : @ ***No CRC Files found***$> ʉ ʉw#: <2 P6: .6@ Can not parse string ! ~ʽT #ñM ! > 6 #6^#6! ~T #! 4M #x] #e w~ T #>2 @ - s M@ File not found ! 4 >2 o: G: „: G: „@ *Match* 2 ! 4@ <-- is, was --> : ) > T : ) M 2 ! 4<2 ~# @ Not a space between CRC values<2 G-CATALOG???mmy,'gamemenu.chn'); chain(dummy) end. (* chuckaluck *) RROR++ <* |): o% |g}o" 2  ; 0T ~T #~A > T > _h : F{͇2h2|: ʲ !\   :\2 ! \  \ ! \  \! \  \<7=Ɓo&   ]  2h2|2   ~$#~# x  : F} *}= ">͇1 ].”#””͡”››tK››͸›* =: =͔="  ʳ ª~#.  ¿~  #~  .+~#0:0~#!A.O.Gy~#0M0 K MMɷ:m2 FSÄCRCKLIST$$$››tK›, › **}|!"*{z*~]*"Ü  DISK FULL: CRCFILE$!"*~#CRC.COM 5.0 6/18/82CRCKFILE???!9" 1 M @ CRC Ver 5.0 CTL-S pauses, CTL-C aborts :] O@ ++Searching for CRCKLIST file++@ Now searching for "CRCKFILE" file++ !  1 .) F!  ͡]͸! ͔0CRCKLIST???CRCKFILE???!9" M à*,*.}|ډ!".*,{z{** u*.".G*.",!".***,}>*.#".ɯ22)! ",". <  NO FILECRC FILE$!   >. @ Checking wi match - : ̓ : J M @ Quantity of lines failed parse test - : ̓ : ~ M @ Quantity of file(s) not found - : ̓ * d͔  ͔ 0T  Җ Wyʩ 0T 0ztiil2 end else if matched = 3 then begin writeln('You won $',bet*payoff3); money := money + bet*payoff3 end else begin writeln('You lost $',bet); money := money - bet end; if money > 0 then begin write('Care to try your luck again? '); read(trm,ch); writeln; end until (money <= 0) or (upcase(ch) <> 'Y'); writeln('You leave with $',money); assign(du*#"ɯ2i2}! "!"]]2 s : ~# ++FILE NOT FOUND++$: F*}’">͇†]<  CANNOT CLOSE CRCFILE$CRCKLISTCRCSK FULL: CRCFILE$  w# !]͐ DONE$!e S!]Q !eZ @ --> FILE: XXXXXXXX.XXX CRC = oS) \<‘@ ++OPEN FAILED++ !" !" * | ʹ) \!~2 #" Ý: ) > T : ) @ ++FILE READ E   --> FILE: GAMES .COM CRC = A0 8E --> FILE: KENO .CHN CRC = E9 4B --> FILE: BJGAME .CHN CRC = E3 E0 --> FILE: BACCARAT.CHN CRC = B7 8A --> FILE: BLACKBOX.CHN CRC = 62 70 --> FILE: CRC .COM CRC = B2 07 --> FILE: WORDS .DAT CRC = E3 66 --> FILE: BLOCK .CHN CRC = A1 46 --> FILE: BOGGLE .CHN CRC = 6A FF --> FILE: CHUCKLCK.CHN CRC = BD 8A --> FILE: DODGE .CHN CRC = 3B F2 --> FILE: GUESSIT .CHN CRC = 2F 7F --> FILE: HANGMAN .CHN CRC = 21 AD --> FILE: HORSEC 4Ø:!4:!5(  ! I3= : [= t:\a:\=_: :] t ?]\ : ҃! 6?Î : 2   ]Q  ?\\ : DM, Q ! "= *3 ##)*= "; */ &# "! *3 #"#  !! "% >!1 . 2' \: 2 : ʩ: ƀo&"* ~ʛ*# +"# ** DMY қ** DM  *; q#p* " . ** #DM*; -e**  *; w* #" )*= *; s#r*; "; : 2 !S 6!"V * "n >!S d*S &T ) ^#V"K O!l ^#V"M :S =2S M K  a*K "G **( * " 3*1 #" " " *5 " > # R : B * +" ! +s#r( ! 6: " * ~2 * #" * +" > ʶ : 2 Ғ * +" : <2 O>ҳ ! 6* #" * ~2 p ̓: AOK = * Ͱ= * ͷ= * Ͱ= *# ͷ= * Ͱ= . g S -A >>!  ~?l W >#^ : /!:' —  ʑ #‹  W ʢ #™ i`N#FogDM!>))덑o|g =¼ DM!>)) = ^#V) ^#V|g}o RAC.CHN CRC = FA 48 --> FILE: BACCARAT.PAS CRC = AB 86 --> FILE: GAMEMENU.CHN CRC = 47 11 --> FILE: 29-DISK .DOC CRC = 3C 0A --> FILE: BLACKBOX.PAS CRC = 77 8C --> FILE: BOGGLE .PAS CRC = D8 E4 --> FILE: CHUCKLCK.PAS CRC = 76 FC --> FILE: DODGE .PAS CRC = 30 EE --> FILE: MAKEFILE.CHN CRC = C0 0B --> FILE: MAKEFILE.PAS CRC = 61 83 --> FILE: GUESSIT .PAS CRC = CB 35 --> FILE: GAMES .PAS CRC = E2 89 --> FILE: HANGMAN .PAS CRC = 70 3A --> FILE: BJGAME .PAS CRC = 51 M "I *K  )*= ^#V"O I G  *G )*= N#F*O ? J*G #"G (*I )*= ^#V*O DM? m*I +"I JI G  *G )*= ^#V"Q *I )*= *G )*= N#Fq#p*I )*= *Q s#r*G #"G *I +"I K I  G M   !M G  :S <2S O!T *G s#r*S &l ) *M s#r*I "M ^I K  X:S <2S O!T *K s#r*S &l ) *I s#r*G "K û!" "    #* #" )*= * #" )*= N#Fq#p   * )*= * ) *= ^#VN#F? H * #" )*= ^#V";  *; ^#V" * )*=  Hit Space: KK : k Used: /k Not used: k *% DMf : remain on 1 !9" ! J> # ->! . *ͪe> # < * v K  K  K !B r+s+p+qA ?  p*A *? :]$Ž l]Q !]6 !E 6!C 6 :C *C &l ~2D U¼:E 2 :D S:E 2:D F:E 2:D V:E 2:D P:E 2 :D N2E ! _{ozgO{ozgi`N#Fogo&og_{_z#W OK = Y -S {-_ ! s+p+q*  ͼ 2 <2 : ! ڗ  K ! 4Á ! 6: =! ڻ * & NK ! 4œ >3  03} Z; { ) # 65 --> FILE: HORSERAC.PAS CRC = 7D FA --> FILE: KENO .PAS CRC = 52 8C --> FILE: GAMEMENU.PAS CRC = F8 C2 --> FILE: BLOCK .PAS CRC = 57 28 --> FILE: READNUM .PAS CRC = 30 1B --> FILE: D .COM CRC = 66 48^#V"; *;  ͪ  *; q#pÝn* " ! p+q* )*= ^#V"; ! 6> ! i* &*; >OK : <2 E:/ *; ^#V*% DMf kK : *; Nf E*; ~ڻWK þE *; ~SK E = ! 6:! ':/ : = !: = : <2 * " !" >! .  * *&͵ "( * *&͵ > j*( #"( *DM*( V"( !" (   K!" }2 : <2 O:* * * "    >! = * DM** +" *( * " Ø* #" *&  1!͍!M4,Ͳþ2!}2!!5zM "l!!5zD "j!*l+))))*j+!s*j# *l#!}2!!5zʻ "l!!+))))*l+!s!!+))))*l+!s*l#_ !!5z"!"l!*l+))))!+!s!*l+))))!+!s*l# !"p*p!ͯE!!!}2o!!}2n!*n&+))))*o&+n&!NEʿ!!*n&+))))*o&+!s*p!"p(!!"p*́#The tank just destroyed an attacker͐b!*7+)!s*&!R}2ß,RN*ŔYou just died!!!͐b!}2ß,RH,!!5z*}20!*7+)n&!*0&+)n&N!*7+)n&!*0&+)n&N}o*7*0&a}oE**0&}21*0&#c*ŔTwo attackers just collided!͐b!!*1&+)n&+))))!*1&+)n&+!s!*7+)!!s!*7+)!!s*7!*7+)!*7+)!*7+)(͡$_)!!R*_s&R&*an&!*as*_n&!*_s!*_n&+))))*an&+n&}2c*c&!}2J!0!95zʀ&}2I!K*I&*J&s*J&#}2J*I&#I&Ŕ Direction? b!8!Ib*I&Q!0!9k}o*I&!0N*&!N}o}oE 'Ŕ How is that? ͐b7&}2Y5'!!5z5'"G!*Gͽ*G#'!!!*&+))))*&+!s*I&!0NEʳ'*&!R}2!!}2!!}2!0}2I!K*I&n&}2 destroyed. If two attackers hit each other, they are͐bŔ@ randomly put somewhere else. If an attacker hits the tank, then͐bŔ9 the attacker is destroyed. As an added bonus, there are !!͐bŔ? mines in the square (and the border of the square). If you hit͐bŔ@ a mine, you are destroyed. If an attacker hits a mine, then the͐bŔ@ attacker is destroyed. Your object is to destroy the attackers.͐bR͐bŔ You can move by:͐bŔ 789͐bŔp!͇Eʎ"!!}2o!!}2n!*n&+))))*o&+n&!NEʋ"!*n&+))))*o&+!s!*p+)*o&s!*p+)*n&s*p!"p!!*n&+))))*o&+n&!aE"!!}2o!!}2nÎ"!*n&+))))*o&+!s*o&}2*n&}2!*n&+))))*o&+n&!aEs#!!}2o!!}2n#!*n&+))))*o&+!s*o&}2*n&}2!!!!5zʠ$*1&+)!!s!*1&+)!!s*1&!*1&+)!*1&+)!*1&+)(͡$_)ß,RŸ,ŔAn attacker just hit a mine.͐b!*7+)!s*&!R}2!!5z_-}2B!*B&+)n&!aET-!!*B&+)n&+))))!*B&+)n&+!s*B&!*B&+)!*B&+)!*B&+)(͡$_)*B&#ë,!*&+))))*&+!s!!!(͡$R_.Ŕ#The tank just destroyed an att!!!K*I&n&͡$}2Y!*&+))))*&+!s*Y&à,?!}2:!}29*&*?&͛EV(!}2:q(*&*?&ͯEq(!}2:*&*@&͛Eʏ(!}29ê(*&*@&ͯEʪ(!}29*:&!N*9&!N}oE(*:&!NE(*9&}2A(*:&}2AY)*:&R,)*9&!NE")!}2A))!}2AY)RY)*9&!NER)! }2AY)!}2A*A&}26"7*6&R¼)!!*7+)n&+))))!*7+)n&+!sß,R*R 456͐bŔ 123͐bŔ= Note that a 5 leaves you in the same place. A move of 0 will͐bŔ= put you in some random place on the square (even on a mine).͐bR͐bŔHit any key to continue͐b!8!bŔWant instructions? b!8!bR͐b*&(!YNE 3/cͯ#*&!a*&!͛}oEg37&!aEU3!}2[3(ͯ#R͐b3*&!NEʩ3Ŕ Well, you got yourself killed!!!͐b3ŔCongratulations, you did }2d!!5zʌ$}2e!*d&+))))*e&+n&R $R!*bÁ$R9$R!TbÁ$RR$R!$bÁ$Rk$R!XbÁ$R$R! b*e&##R͐b*d&##}2^"_"a*^&R$*_n&!R*_s&R$&R%*_n&!*_s&R#%*an&!R*as&RA%*an&!*as&Rv%*an&!R*as*_n&!R*_s&R¨%*an&!R*as*_n&!*_s& R%*an&!*as*_n&acker͐b*&!R}2!!5z\.}2B!*B&+)n&*&N!*B&+)n&*&N}oEQ.!*B&+)!s*B&#-.R—.ŔThe tank just destroyed a mine͐b.R.ŔThe tank just destroyed you͐b!}2.R.!*&+))))*&+!sŔ Dodge͐bŔ( You are in a 30 x 15 square. There are !!́ attackers,͐bŔA one tank, and you. If you hit one of the attackers (or the tank)͐bŔ= you are  it!!!͐bR͐bŔWant to try again? bͽ!8!bR͐b*&(!YaE 3!v gamemenu.chn=!vʹb!͐bR͐bŔWant to try again? bͽ!8!bR͐b*&(!YaE 3!v gamemenu.chn=!vʹbnkloc: loc; myloc : loc; atack : array[1..numattackers] of loc; ch : char; left : 0..numattackers; nines : 0..ninemax; saydir : direction; dummy : file; (* * makeboard * creates the board and place every thing in at random places *) procedure makeboard; var placed : integer; xloc : xindex; yloc : yindex; i,j : integer; begin nines := ninemax; for i := 1 to width do for j := 1 to length do square[i][j]o destroy the 6 attackers. * * You can move by: * 789 * 456 * 123 * * Note that 5 leaves you in the same place. A move of 0 will put you * in some random place on the square (even on a mine) *) program dodge(input, output); const numattackers = 6; (* number of attackers *) length = 30; (* length of playing field *) width = 15; (* width of playing field *) numines = 15; (* number of mines *) ninemax = 2; (* number of times (width) end; square[yloc][xloc] := tank; tankloc.xcord := xloc; tankloc.ycord := yloc; while square[yloc][xloc] <> nothing do begin xloc := 1 + random(length); yloc := 1 + random(width) end; square[yloc][xloc] := me; myloc.xcord := xloc; myloc.ycord := yloc; end; (* * print * print out the field *) procedure print; var i : xindex; j : yindex; begin gotoxy(1,1); for j := 1 to width do begin for i := 1 to len := nothing; left := numattackers; for i := 1 to length do begin square[1][i] := mine; square[width][i] := mine end; for i := 1 to width do begin square[i][1] := mine; square[i][length] := mine end; placed := 0; while placed < numines do begin xloc := 1 + random(length); yloc := 1 + random(width); if square[yloc][xloc] = nothing then begin square[yloc][xloc] := mine; placed := pthe 9 escape can be used *) type (* what can be at a location *) what = (me,attacker,tank,mine,nothing); xindex = 0..length; yindex = 0..width; (* directions something can move *) { direction = (stay,n,ne,e,se,s,sw,w,nw,nowhere);} direction = (nowhere,sw,s,se,w,stay,e,nw,n,ne); (* the location of an object *) loc = record xcord : xindex; ycord : yindex end; var (* the playing field *) square : array[1..width,1..length] of what; tagth do case square[j][i] of me : write('*'); tank : write('T'); attacker : write('$'); mine : write('X'); nothing : write(' ') end; writeln end end; (* * move * attempt to move something from curx,cury in the direction * indicated. returns what was on the location. *) function move(var curx:xindex;var cury:yindex;where:direction): what; begin case where of n : cury := cury - 1; (* * dodge * You are in a 30 x 15 square. There are 6 attackers, one tank, * and you. If you hit one of the attackers (or the tank), you * are destroyed. If two attackers hit each other, they are randomly * put somewhere else. If an attacker hits the tank, then the * attacker is destroyed. As an added bonus, there are 15 mines * in the square (and the border of the square). If you hit a mine * you are destroyed. If an attacker hits a mine, then the attacker * is destroyed. Your object is tlaced + 1 end end; placed := 1; while placed <= numattackers do begin xloc := 1 + random(length); yloc := 1 + random(width); if square[yloc][xloc] = nothing then begin square[yloc][xloc] := attacker; atack[placed].xcord := xloc; atack[placed].ycord := yloc; placed := placed + 1 end end; while square[yloc][xloc] <> nothing do begin xloc := 1 + random(length); yloc := 1 + random   stay: ; s : cury := cury + 1; w : curx := curx - 1; e : curx := curx + 1; nw : begin curx := curx - 1; cury := cury - 1 end; sw : begin curx := curx - 1; cury := cury + 1 end; ne : begin curx := curx + 1; cury := cury - 1 end; se : begin curx := curx + 1; cury := cury + 1 end end; m which := xdir end else begin case xdir of w: if ydir = n then which := nw else which := sw; e: if ydir = n then which := ne else which := se; end end end; (* Which *) (* * checkmove * checks to see what happens to an attacker when it is moved *) procedure checkmove(i : integer; dir : what); var remember, index : 1..numattackers;  myloc.xcord := 1 + random(length); ch := '0' end; saydir := command[ch]; ask := move(myloc.xcord,myloc.ycord,command[ch]); square[myloc.ycord][myloc.xcord] := me end end; (* * moveall * moves all the attackers around, and the tank *) procedure moveall; var i : 1..numattackers; (* index used to run through all attackers *) (* * which * given a loc, it decides which direction to go so as to come closer * to you. returns the dir for the first attacker *) atack[i].xcord := 1 + random(length); atack[i].ycord := 1 + random(width); (* move the attacker *) checkmove(i,move(atack[i].xcord,atack[i].ycord,which(atack[i]))); (* repeat the same with the other attacker *) atack[remember].xcord := 1 + random(length); atack[remember].ycord := 1 + random(width); checkmove(remember,moove := square[cury][curx] end; (* * ask * ask the user where he wants to go, then attempt to go there. * returns what the player lands on. *) function ask:what; var command:array['0'..'9'] of direction; dir : direction; ch : char; i : integer; begin (* init the commands *) dir := nowhere; for ch := '0' to '9' do begin command[ch] := dir; dir := succ(dir) end; write('Direction? '); read(trm,ch); if not (ch in ['0 begin case dir of nothing : square[atack[i].ycord][atack[i].xcord] := attacker; tank : begin writeln('The tank just destroyed an attacker'); atack[i].xcord := 0; left := left - 1 end; me : begin writeln('You just died!!!'); myloc.xcord := 0 end; attacker: begin (* find out which attacker we hit *) ection. *) function which(curr : loc):direction; var xdir, ydir : direction; begin xdir := stay; ydir := stay; if myloc.xcord > curr.xcord then xdir := e else if myloc.xcord < curr.xcord then xdir := w; if myloc.ycord > curr.ycord then ydir := s else if myloc.ycord < curr.ycord then ydir := n; if (xdir = stay) or (ydir = stay) then begin if xdir = stay then which := ydir else ve(atack[remember].xcord, atack[remember].ycord,which(atack[remember]))); end; mine : begin writeln('An attacker just hit a mine.'); atack[i].xcord := 0; left := left - 1 end end; end; (* CheckMove *) begin (* MoveAll *) (* for each attacker, if he is still alive, move him toward you *) for i := 1 to numattackers do begin if atack[i].xcord <> '..'9']) or ((ch = '0') and (nines = 0)) then begin writeln('How is that? '); ask := ask end else for i := 16 to 24 do (* clear the screen under the board *) begin gotoxy(1,i); clreol; end; gotoxy(1,18); begin square[myloc.ycord][myloc.xcord] := nothing; (* on a command of '0', relocate yourself randomly *) if ch = '0' then begin nines := nines - 1; myloc.ycord := 1 + random(width);  for index := 1 to numattackers do if (atack[i].xcord = atack[index].xcord) and (atack[i].ycord = atack[index].ycord) and (i <> index) then remember := index; writeln('Two attackers just collided!'); (* remove it from the field *) square[atack[remember].ycord][atack[remember].xcord] := nothing; (* choose a random spot  0 then begin square[atack[i].ycord][atack[i].xcord] := nothing; checkmove(i,move(atack[i].xcord,atack[i].ycord,which(atack[i]))) end end; (* move the tank, note that the tank will destroy anything in its way * (including mines) *) square[tankloc.ycord][tankloc.xcord] := nothing; case move(tankloc.xcord,tankloc.ycord,which(tankloc)) of attacker : begin writeln('The tank just destroyed an attacker'); myloc.xcord := 0 else begin moveall; print end; writeln; end; if myloc.xcord = 0 then writeln('Well, you got yourself killed!!!') else writeln('Congratulations, you did it!!!'); writeln; write('Want to try again? '); clreol; read(trm,ch); writeln; until upcase(ch) <> 'Y'; assign(dummy,'gamemenu.chn'); chain (dummy) end. cker is destroyed. As an added bonus, there are ',numines); writeln(' mines in the square (and the border of the square). If you hit'); writeln(' a mine, you are destroyed. If an attacker hits a mine, then the'); writeln(' attacker is destroyed. Your object is to destroy the attackers.'); writeln; writeln(' You can move by:'); writeln(' 789'); writeln(' 456'); writeln(' 123'); writeln(' Note that a 5 leaves you in the same place. A move of 0 will'); writelprogram GameMenu; (* Menu for pascal games by Bruce Berryhill 10Jan85 *) var Answer: char; ChnFile: file; begin writeln; writeln('Hit any key to continue'); repeat read(trm,answer); clrscr; writeln ('a Baccarat'); writeln ('b Blackjack'); writeln ('c Black Box'); writeln ('d Block Letters'); writeln ('e Boggle'); writeln ('f Chuck-a-luck'); writeln ('g Dodge'); writeln ('h left := left - 1; for i := 1 to numattackers do if (atack[i].xcord = tankloc.xcord) and (atack[i].ycord = tankloc.ycord) then atack[i].xcord := 0 end; mine : writeln('The tank just destroyed a mine'); me : begin writeln('The tank just destroyed you'); myloc.xcord := 0 end; nothing : end;1!͍!^#KͲR͐bŔHit any key to continue͐b!8!{bcŔ a Baccarat͐bŔ b Blackjack͐bŔ c Black Box͐bŔd Block Letters͐bŔ e Boggle͐bŔf Chuck-a-luck͐bŔg Dodge͐bŔ h Guess it͐bŔ i Hangman͐bŔ j Horse Race͐bŔk Keno͐bR͐bŔ7Which game would you like to play? [a-k] to quit b!8!{b*{&(}2{*{&Q!A!Kk*{&! N}oE *{&An(' put you in some random place on the square (even on a mine).'); writeln; writeln('Hit any key to continue'); read(kbd,ch); end; (* dodge *) begin write('Want instructions? '); read(trm,ch); writeln; if upcase(ch) = 'Y' then inst; repeat clrscr; randomize; makeboard; print; while (myloc.xcord <> 0) and (left > 0) do begin (* test to see if you killed yourself *) if ask <> nothing then  Guess it'); writeln ('i Hangman'); writeln ('j Horse Race'); writeln ('k Keno'); writeln; write ('Which game would you like to play? [a-k] to quit '); read(trm,Answer); Answer := upcase(Answer); until (Answer in ['A' .. 'K']) or (Answer = ^M); case Answer of 'A' : assign(ChnFile,'baccarat.chn'); 'B' : assign(ChnFile,'bjgame.chn'); 'C' : assign(ChnFile,'blackbox.chn'); 'D' : assign(ChnFile,' square[tankloc.ycord][tankloc.xcord] := tank end; (* * inst * prints out the instructions *) procedure inst; begin writeln(' Dodge'); writeln(' You are in a 30 x 15 square. There are ',numattackers:1,' attackers,'); writeln(' one tank, and you. If you hit one of the attackers (or the tank)'); writeln(' you are destroyed. If two attackers hit each other, they are'); writeln(' randomly put somewhere else. If an attacker hits the tank, then'); writeln(' the attaR!!K baccarat.chn==#BR "!K bjgame.chn==#CR."!K blackbox.chn==#DRO"!K block.chn==#ERq"!K boggle.chn==#FR•"!K chucklck.chn==#GR¶"!K dodge.chn==#HR"!K guessit.chn==#IR"!K hangman.chn==#JR #!K horserac.chn==#KR=#!Kkeno.chn=c*{&! aE[#!KʹbRI!K hangman.chn="JRJ!K horserac.chn=#KRK!Kkeno.chn=c*{&!   block.chn'); 'E' : assign(ChnFile,'boggle.chn'); 'F' : assign(ChnFile,'chucklck.chn'); 'G' : assign(ChnFile,'dodge.chn'); 'H' : assign(ChnFile,'guessit.chn'); 'I' : assign(ChnFile,'hangman.chn'); 'J' : assign(ChnFile,'horserac.chn'); 'K' : assign(ChnFile,'keno.chn'); end; clrscr; if Answer <> ^M then chain(ChnFile); end. H\<z5+)+<z {0Gɯgo||H}||/g}/o#}o&K[xAJSJDM!b"!6J"DM'ͬͬdͬ ͬ} wͦWͧ _}8(8J`9{T]=o`9y 28!?"9!!>2 :D]SXN]D [ (!e}̈́A8Q0G: x@!\w# (   yV. V!h6# (*(.(!8}(*(̈́w#>?> w#a{ |͒}͛Ɛ'@'7||}>"C"6# ""͐ͩ*B"[R5*"^#V#a}.; OJ , ; !U >,k- o&0%,` }g; }؉}颋.:}8c~I$I~L*kٷx˸; }0G,͙<},-(-J ! >0 a` o8 Oþ >um.`1pF,t6|!wS<.z}[|%FXc~ur1}Oٯx(<˸ͨ 8; !~Jͨ 0O!><ͨ 8 =  7 <` O ; 7 0 W-J OT0 j oD,:j !I}袋.}8c~I$I~L!>xW^8/w >uJ u` }>(; xQ }} ˸T}ٕ(0D=C ,= ( [ 0%D , 7 ͏ ?(8u x O - ; 8˸x X ,-xG}; }م 9; .>#n0[ D = - nx P ,-(-˸G,-; }ٕ? 9.>͏ 8u ?= u+-(>O 0u O 8^#V#N#FO/o&9O/o&9!9(> (G!9 w#E͊w}8uRB0 >R@RR!+ͨ z R!+ͨ z <!+ͨ z <!+ͨ z <!#ͨ z <!+ͨ z T]KB!z> S>))0 = |JJDMgo>jB0 7?= u` ` 77 ` = O nf^VNF!DLT\I!!53!r1!\!> x #-= o˸xO(- }(x>8(C ,C `iM!>u|; |J>| )=|(DMbo˸ͦ88ͦx(0 8> Mx(>-Ͳ{(ay(Ͱͦ \z(>.Ͳ (Ͱ ~ͦ{>EͲ>+|(|Dg>-Ͳ|/ 0:p# ~# +>0w#,-  60#J˸}րogM| .ͫCopyright (C) 1984 BORLAND IncA KAYPRO II-84d IVctedP=  ERC1B1~7#~=% o&ͦoͦܐԩͣ}!!"8~#(}:$= +*!Z!*B!!:(=2!Z: <2!!!:O::O:!*B͏ ?x P , 78ƀ8ƀ8ox٨!دoGOW_gɷɷ|لg{ً_zيWyىOxوG|ٔg{ٛ_zٚWyٙOx٘Gxٸyٹzٺ{ٻ|ټx٨ xx(ͼ ?}ٽÏ }ց; <(; 7D = |٤g{٣_z٢Wy١Ox٠GD u J }x>uu}ƀ/ƀo; -J }0W-J W,}l˸ͨ 8 ; ` x( -ͨ 8J -ͨ 8,J }l8;*!` ! >u` ` u--- J ,,,-xGg?+2n*8t z~,->uxu  (C = ~> x0w#xG%P %P ZJDM%P = _~65i+~hìx-Sx9?+{Η@}|C C gZJDM0D ,7}o˸  #yO!@9i&   # w# /w#*###w* N#FB ͟r+s> !T]>)j)0 0= UR!#U*^#V#N#F#^#V>">!2DM"~x(L* :O(o:" C}=( ?*-N#Fp+qq#p! * F+N+++V+^Bq#p>>> SRѷR* s#r$ s#r"S"! N#FB(^x * 6#[<(H*! Kq#p##K[! *! 4 #4! x *$ *>w""{_!"*nf}(HR0nf" ^VMDnfutqp J= B== ͯ}8= ͵}/ͭ !*###~-_~(4Q6*>2>*##w:>*##~*#~(E[ ( ( ( !][ ( ( ((w#(6!]~-#8~>7  [>OkͼMs #rkͼpX á[ [ (( #w(q*#~[ (  *##~6͜O$*#~(08ʦ=ʦ==ʩ=ʬò+###~-_q46͡> *:4^q}Ò*|(program games; (* Loader fo games chain by Bruce Berryhill 10Jan85 *) var dummy: file; begin assign(dummy,'gamemenu.chn'); chain(dummy) end.  w#!9! E9!!9~(+F͊!"9!(#>2*Ͳ"|>" :( ͆ *6#w*6#6 !\$![ (̈́( #:~CONTRMKBDLSTAUXUSR>2$*#~ Ͷ$*:> >w###6  #6++p>2S-$Ͷ:*6###ww#w$w#w: ##N#F*B> w#w#[s#r>2S$Ͷ$*6 #-Nw#Fwq#p#6#w#w#w* :( ͒*s#r*s#r"* 5KB!>u~#fo{_"*R0RnfR0KqputsrNF( ^VNF^V*SutKqp R*R(~w~wnf ut"6# * *!""*NFy(* "*B0Cnf* [R*"*RS[s#r^#VS>O"w2x2!"" @*>2"!"""!\Ͳ*: !~6go(\R*s#r_2x( s xM|( M6-#͐ͦ[R8 (G> ͒C~͒#*ͦC!h !lTRUEFALSEͦ!9^#(~#(G~͒#> ͒> Ò "F![(#RR0*4#4> RR *4 #4(>>2$*V(/˖:(#~+ x y2!͵( =( X:(R*:(###~-_-͌X> :("͟"*^˞*V˖0 SRѷR8A* N#F#s#r$ 0})jS\: *^ F* < >26"~͟*-w#ww#͟"~ <@*Ͳ!\  <ʮ!\$> >2*|>! * \$\<(!: [1Á\!(f"> 2:!<"F( #~#6e>!["N>!~8>O6*"w (=(&("( :(N 8y(~#x+% (6*#~[*#~ *~(h#"b=  8(T]DMR0 -a%}̈́o*!~6o&͠|ͣ}%^C User break1:% I/O% Run-time% error ͒%, PC=[R"͍% Program aborted*1!͍! LͲ!L gamemenu.chn=!Lʹb error ͒%, PC=[R"͍% Program aborted*1!͍!Ͳ!L gamemenu.chn=!Lʹ  1!͍!# Ͳn""E*E^#V"*!,+._b!, *E!(͞*(!aEV ŔPlease enter a number͐b***Es#r*(!NEŔThis is match it͐bR͐bŔ)I will choose a number between 1 and 100.͐bŔ"You will try to guess that number.͐bŔ2If you guess wrong, I will tell you if you guessed͐bŔtoo high, or too low.͐bŔ you have !!́ tries to get the number.͐bR͐bŔEnjoy͐bR͐bŔ Your guess?  else if guess < number then writeln('too low') else writeln('correct!!!') end end end; (* getnum *) (* * main *) begin instructions; randomize; while pos(ch,'nN')=0 do begin guess := 0; numtry := 0; number := random(maxnum)+1-minnum; (* get number *) while (numtry < maxtrys) and (guess <> number) do begin getnum; numtry := numtry + 1  dummy : file; {$I readnum } (* * instructions * prints out the instructions *) procedure instructions; begin writeln('This is match it'); writeln; writeln('I will choose a number between 1 and 100.'); writeln('You will try to guess that number.'); writeln('If you guess wrong, I will tell you if you guessed'); writeln('too high, or too low.'); writeln('you have ',maxtrys,' tries to get the number.'); writeln; writeln('Enjoy');1!͍!/'JͲ& !vͲ!"p!! m5zd "n!v*nn&Q!0!9kE[ *p! !v*nn&!0R"p*n# *p"*c!̮ words.dat=!̮ b!̮8!ͳb! "Q!Q!!"!}2!*"d!̮*db!̮8!ͳb!! m5zr!"b!*bn&(!-}oEi!!-Q!*bn&(a!*b#!!}2\!}2[*\&Ex"!! Ŕ Next guess? b!8!]b*]&(}2]!b!y*y!d͛E"ŔIllegal number͐b͵!m"*y*x&͛E-"Ŕtoo high͐bm"*y*x&ͯEV"Ŕtoo low͐bm"Ŕ correct!!!͐bg *{&e.nN|!NEv#!"y!}2w!d!!R}2x*w&!ͯ*y*x&a}oE"͵!*w&!}2wù"R͐b*y*x&aE5#ŔThe number was *x&!͐bR͐bŔwant to try again? b!8!{bR͐bt"!G gamemenu.chn=!Gʹbumber was *x&!͐bR͐bŔwant end; writeln; if guess <> number then writeln('The number was ',number); writeln; write('want to try again? '); read(trm,ch); writeln; end; assign(dummy,'gamemenu.chn'); chain(dummy) end.  writeln; end; (* instructions *) (* * getnum * get a guess from the human, * with error checking *) procedure getnum; begin write('Your guess? '); (* * wait for a character *) begin readint(guess); if guess > maxnum then begin writeln('Illegal number'); getnum end else begin if guess > number then writeln('too high') ͝E!! gamemenu.chn=!ʹbu"*]&!-EN"!! ŔYou have already used '*]&́'.b!}2[u"!-Q*]&a!!}2\Á!*[&Eʟ"!! R! e.!qb*]&!-}oE"*!"!"R! !!! m5zW#"U!*Un&(!-E6#!*Un&Rb*R!"RB#R!-bR! b*U#"! !!A!Z5zʦ#}2T*T&!-Eʛ#*T&Rb*T&#l#*R! mNE#!}2*(* * GUESS IT * A computer guessing game *) program guessit (input,output); const maxtrys = 6; (* user allowed 6 tries to guess number *) maxnum = 100; (* maximum number *) minnum = 1; (* minimum number *) var ch : char; (* used to answer questions *) guess : integer; (* human's guess *) number: minnum..maxnum; (* the number itself *) numtry: 0..maxtrys; (* number od times human has guessed *)   R#!!R!0b'%R $!!Ŕ---b'%RF$!!R!/b!!R!/b'%R$! !R!\b!!!R!\b'%R¸$!!R!Ib!!R!Ib'%R$!! R!/b!! R!/b'%R'%!! R!\b! ! R!\b!!*&Ec%ŔRats!! You guessed it!!͐b%ŔThe word was : ! !q͐bR͐bŔ9Due to the violent nature of your demise, the  wordsletters := wordsletters + [upcase(aword[i])]; end; (* * readguess : * asks for another letter that the player expects to be in the word. * a letter that already has been guessed is not accepted *) procedure readguess; var thisguess : char; invalid, erase : boolean; begin invalid := true; erase := false; while invalid do begin gotoxy(1,10); write('Next guess? '); read(trm,thisguess); thisguess := upcase(thisguess); ummy : file; (* * convert * converts a string to the number that it represents. all non-numeric * characters are ignored. *) function convert(number : word) : integer; var result : integer; strindex: integer; begin result := 0; for strindex := 1 to length(aword) do if number[strindex] in ['0'..'9'] then result := result * 10 + ord(number[strindex]) - ord('0'); convert := result; end; procedure initialize; begin clrscr; assign(dict,) do begin if upcase(aword[wordindex]) in guesses then begin write(aword[wordindex]); correctcount := correctcount + 1; end else write('-'); write(' '); end; gotoxy(10,7); for guessindex := 'A' to 'Z' do if guessindex in guesses then write(guessindex); if correctcount = length(aword) then guessedit := true; end; (* * printhang * prints the hangman *) procedure printhang; brest of the͐bŔscene has been censored.͐bŔ 'Y'; assign(dummy,'gamemenu.chn'); chain(dummy) end. ͐bŔ Your horse * !́ has won the race!͐b"+R͐bŔPlayer number *+!́% type 'p' to print track, cr to rollb!8!&bR͐b*&&(!PNEʖ&<#*&&!NEʲ&!}2Ç()#}2!)#}2 Q*!&a* &a*!&* &a!"Ŕ You rolled a *!&!́ and a * &!bŔ with a total of *!&* &!͐bŔWhich do you want? b!$*$!"-}oE-(ŔSorry, but only *!&!́, * &!  program horserace (input, output); const maxplayer = 10; maxhorses = 12; (* each player has 12 horses *) type horse = record horseloc : 0..10; togo : 0..10; end; var track : array[1..maxplayer, 1..maxhorses] of horse; numplayers : integer; curplayer : 1..maxplayer; win : boolean; i,j : integer; dummy : file; {$I readnum } procedure getnumplayers; begin write('How many players? '); readint(numplayers); rse. *) procedure movehorse (player,horsenum : integer); begin track[player,horsenum].togo := track[player,horsenum].togo - 1; track[player,horsenum].horseloc := track[player,horsenum].horseloc + 1; win := (track[player,horsenum].togo = 0); if win then begin writeln; writeln('Congratulations player ',player); writeln('Your horse ',horsenum,' has won the race!') end; end; begin (* play *) writeln; write('Player number ',player,' type ''p'' to diemax; (* * throwdie * uses the random function to throw the dice. *) function throwdie: integer; begin throwdie := 1 + random(diemax) end; (* * print. * displays the tracks. *) procedure print; var pnum : 1..maxplayer; curhorse : 1..maxhorses; length : 1..10; sum : 1..10; ch : char; begin for pnum := 1 to numplayers do begin writeln('Player number ',pnum); for curhorse := 1 to maxhorses do begin writeln;  (* main program *) win := false; getnumplayers; maketracks; curplayer := 1; while not win do (* win is set to true in procedure movehorse *) begin randomize; play (curplayer); if curplayer = numplayers then curplayer := 1 (* go back to the first player *) else curplayer := curplayer + 1 (* next player *) end; writeln; writeln; assign(dummy,'gamemenu.chn'); chain(dummy) end. (* horserace *)  while (numplayers <= 0) or (numplayers > maxplayer) do begin writeln('Sorry, only numbers between 1 and ',maxplayer,' are allowed.'); write('How many players? '); readint(numplayers) end end; (* * maketracks * initializes track.togo to the correct * handicaps, and track.horseloc to 0 to start * the game. *) procedure maketracks; begin for i := 1 to numplayers do begin track[i,1].togo := 4; track[i,2].togo := 6; track[i,3].togo :print track, cr to roll'); read(trm,ch); writeln; if upcase(ch)='P' then (* player types a P to request *) print; (* a display of the tracks *) if ch = ^C then win := true else begin die1 := throwdie; die2 := throwdie; poshorses := [die1, die2, (die1 + die2)]; write('You rolled a ',die1,' and a ',die2); writeln(' with a total of ',(die1 + die2)); write('Which do you want? '); readint(horsenum); wh write(curhorse:2,' - '); sum := track[pnum,curhorse].togo + track[pnum,curhorse].horseloc; for length := 1 to sum do if length = track[pnum,curhorse].horseloc then write(' (*)') else write(' ( )') end; writeln; writeln; writeln('Hit any key to continue'); read(trm,ch); end; writeln end; (* print *) (* * movehorse. * increments horseloc and decrements togo * to move the ho= 6; track[i,4].togo := 8; track[i,5].togo := 8; track[i,6].togo := 10; track[i,7].togo := 6; track[i,8].togo := 6; track[i,9].togo := 4; track[i,10].togo := 4; track[i,11].togo := 2; track[i,12].togo := 2; for j := 1 to maxhorses do track[i,j].horseloc := 0 end end; procedure play (player : integer); const diemax = 6; var ch : char; horsenum : integer; poshorses : set of 1..12; die1, die2 : 1..ile not (horsenum in poshorses) do begin writeln('Sorry, but only ',die1,', ',die2,', or ',(die1 + die2)); writeln(' is allowed.'); write('Which do you want? '); readint(horsenum) end; if horsenum = (die1 + die2) then movehorse (player, (die1 + die2)) else begin movehorse (player,die1); if not win then movehorse (player, die2) end end end; (* play *) begin   1!͍!'Ͳ%"-*-^#V"!+._b! *-!͞*!aEV ŔPlease enter a number͐b**-s#r*!NEŔ Input your !!́ spots, one at a time. (max 80)͐b!}2 Q !f* &!ͯE!ŔSpot #* &!!́ ? b! * !ͯ* !P͛}oEI!Ŕillegal spot number.͐b!* !f -Eʕ!ŔYou have already chosen spot * !͐b!* &!}2 !f -Q* a !f ! *) cost = 1.20; (*cost to play a game *) type spottype = set of 1..totalspots; var compspots : spottype; (* spots the computer chooses *) playerspots : spottype; (* player's spots *) money : real; (* player has this much money *) ch : char; (* input char to see if user wishes to conyinue *) dummy : file; {$I readnum } (* * getspots * get the player's 8 spots from him *) procedure getspots; var ͐bR͐b!!`͡*_&(!NaEL&g !"R͐bŔWant to play Keno again? b!8!_bR͐b%R͐bŔ&All right then leave, see if i care!!!͐b!`!}E&Ŕ You made $!`!!@͐b&Ŕ you lost $!`˸!!@͐b!/ gamemenu.chn=!/ʹbEstŔ You made $!`!!@͐1 + (random(totalspots)); if not (spot in compspots) then begin compspots := compspots + [spot]; i := i+1; end; end; (* * print out the computer's spots in * order by going linearly through * all numbers *) i := 0; spot := 0; while i totalspots) then writeln ('illegal spot number.') else if spot in playerspots then  program keno (input,output); const payoff5 = 10; (* for 5 spots player gets $10 *) payoff6 = 100; (* for 6 spots player gets $100 *) payoff7 = 2200; (* for 7 spots player gets $2200 *) payoff8 = 25000; (* for 8 spots player gets $25000 *) totalspots = 80; (* total of 80 possible spots *) numcompspots = 20; (* computer picks 20 spots *) numplayerspots = 8; (* player gets 8 spots  writeln end; (* * score * find out how much (if anything) the * player has won *) procedure score; var i : 0..numplayerspots; (* number of matches made *) spot : 1..totalspots; (* current spot number *) begin money := money - cost; (* charge for the card *) i := 0; for spot := 1 to totalspots do if (spot in compspots) and (spot in playerspots) then i :=+ i+1; if i in [5,6,7,8] then begin write('You lucky person, you h&!bŔ matches͐bŔThat means you have made b*&RP$R! !͐b!`! ͳ !`͡%R$R!d!͐b!`!dͳ !`͡%R$R!!͐b!`!ͳ !`͡%R%R!a!͐b!`!aͳ !`͡<%ŔSorry, but you only matched *&!͐bR͐b!`!}Eʘ%ŔYour total money is $!`!!@͐b%ŔSo far you have lost $!`˸!!@ writeln ('You have already chosen spot ',spot) else begin i := i+1; playerspots := playerspots + [spot] end end end; (* * computer * have the computer pick its spots *) procedure computer; var i : 0..numcompspots; (* number of spots chosen so far *) spot : 0..totalspots; begin i := 0; compspots := []; writeln ('The computer chooses '); while i < numcompspots do begin spot :=   ave ',i); writeln(' matches'); write('That means you have made '); case i of 5: begin writeln(payoff5); money := money + payoff5 end; 6: begin writeln(payoff6); money := money + payoff6 end; 7: begin writeln(payoff7); money := money + payoff7 end; 8: begin eadln(nextword); end; writeln('That''s all, folks!'); seek(dict,0); nextword := ''; str(numwords,nextword); write(dict,nextword); close(dict); assign(dummy,'hangman.chn'); chain(dummy) end.  writeln(payoff8); money := money + payoff8 end; end end else writeln('Sorry, but you only matched ',i); writeln; if money >= 0 then writeln('Your total money is $',money:4:2) else writeln('So far you have lost $',abs(money):4:2); writeln end; begin money := 0; while upcase(ch) <> 'N' do begin getspots; computer; score; writeln; write('Want to play Keno again? '); program makedict; (* * this program makes the datafile that is used by the hanggman game. *) const stringsize = 10; type word = string[stringsize]; var dict : file of word; nextword : word; numwords : integer; dummy : file; (* * the dictionary for hangman is a file of strings. it cannot be a text * file because seeking is not allowed on text, and hangman uses a random * seek to get the word. the first string in the file contains the * number of words in th1!͍!!Ͳ!" !Ͳ!̮ words.dat=!̮ b!!! t!̮[!bŔ>Type the words to be entered into the dictionary; no more than͐bR! !́& letters long. Type control-Z to exit.͐b !Ͳ!+ ._b!͝}o! m!͛}oE:!!̮[!b*!" !Ͳ!+ ._b ŔThat's all, folks!͐b!̮!b !Ͳ*!! t!̮[!b!̮-b! hangman.chn=!ʹb́That's a read(trm,ch); writeln end; writeln; writeln('All right then leave, see if i care!!!'); if (money >= 0) then writeln('You made $',money:5:2) else writeln('you lost $',abs(money):5:2); assign(dummy,'gamemenu.chn'); chain(dummy) end. e dictionary. *) begin numwords := 0; nextword := ''; assign(dict, 'words.dat'); rewrite(dict); str(0,nextword); write(dict,nextword); writeln('Type the words to be entered into the dictionary; no more than'); writeln(stringsize:1,' letters long. Type control-Z to exit.'); nextword := ''; readln(nextword); while not eof(con) and (length(nextword) > 0) do begin write(dict,nextword); numwords := numwords + 1; nextword := ''; r  (* a procedure to input numbers with verification *) (* Bruce Berryhill 13 Jan 85 *) procedure readint(var innum: integer); var instring : string[20]; temp, error : integer; begin repeat temp := innum; (* save the variable *) readln(instring); (* input a number string *) val(instring,innum,error); (* convert the string into a number *) if error <> 0 then begin (* the string wasn't a number *) writeln('Please enter a number'); (* so prompt for a number *) innum := temp; (* and restore the variable *) end; until error = 0; end;       !  "  #  $  %  &  '