1
0
mirror of https://github.com/rfivet/BCG101.git synced 2024-12-29 21:46:32 -05:00
BCG101/factory/ACEYDU.BAS

51 lines
1.5 KiB
QBasic

10 REM *** GAME OF ACEY-DUCEY WRITTEN BY BILL PALMBY
30 REM *** TRANSLATED TO RSTS/E BY DAVE AHL, DIGITAL
40 REM *** EDUSYSTEM 50 REFACTORING BY RENAUD FIVET
80 DIM D$(3)\ D$(0)="JACK"\ D$(1)="QUEEN"\ D$(2)="KING"\ D$(3)="ACE"
90 DEF FNC(C)=INT(13*RND(1))+2
100 RANDOMIZE
101 PRINT "ACEY-DUCEY IS PLAYED IN THE FOLLOWING MANNER:"
102 PRINT "THE DEALER (COMPUTER) DEALS TWO CARDS FACE UP."
103 PRINT "YOU HAVE THE OPTION TO BET OR NOT TO BET DEPENDING"
104 PRINT "ON WHETHER OR NOT YOU FEEL THE NEXT CARD WILL HAVE"
105 PRINT "A VALUE BETWEEN THE FIRST TWO."
106 PRINT "IF YOU DO NOT WANT TO BET, INPUT A 0."
110 PRINT
160 Q=100
190 PRINT "YOU NOW HAVE"Q"DOLLARS."
195 PRINT
260 PRINT "HERE ARE YOUR NEXT TWO CARDS..."
270 A=FNC(A)
300 B=FNC(B)
330 IF A>=B THEN 270
340 C=A\ GOSUB 760
500 C=B\ GOSUB 760
650 PRINT
660 PRINT "WHAT IS YOUR BET";\INPUT M
670 IF M>0 THEN 680
675 PRINT "CHICKEN!!"\PRINT
677 GOTO 260
680 IF M<=Q THEN 730
690 PRINT "SORRY, MY FRIEND, BUT YOU BET TOO MUCH"
700 PRINT "YOU HAVE ONLY"Q"DOLLARS TO BET."
710 GOTO 650
730 C=FNC(C)\ GOSUB 760
740 GOTO 910
760 IF C<11 THEN 810
770 PRINT " ";D$(C-11)
780 RETURN
810 PRINT C
820 RETURN
910 IF C<=A THEN 970
930 IF C>=B THEN 970
950 Q=Q+M\ PRINT "YOU WIN!!!"
960 GOTO 190
970 Q=Q-M\ PRINT "SORRY, YOU LOSE."
980 IF Q>0 THEN 190
1000 PRINT
1010 PRINT "SORRY, FRIEND, BUT YOU BLEW YOUR WAD."
1020 PRINT "TRY AGAIN (YES OR NO)";\INPUT A$
1030 IF A$="YES" THEN 110
1040 PRINT\PRINT "O.K. HOPE YOU HAD FUN!!"
1050 END