ROM Computer Magazine Archive ROM MAGAZINE ISSUE 3 — DECEMBER 1983/JANUARY 1984 / PAGE 20

Slot Machine
by Tuong (Tom) Tran

    The program below is a slot machine that works through the use of ATARI's built in (special) character set. This program uses special control characters that don't show up on our printer. For this reason we have made our own listing conventions in this issue. These will be used in any program that we use special characters. Before you type in the program below you should first make yourself familar with the listing conventions. The game is very simple:Push the space bar and the one-arm bandit begins to turn. After a few seconds it will stop and give you the three objects. If all three are the same you win! There are four different objects. They are a man, a woman, a sundae and an alien. Each time you press the space bar you lose fifty cents but have the chance of winning alot more. To start your money at zero just pressed 'R'.
     If you have any problems with the program feel free to drop us a line. Also if you have any changes that you feel should be added to this program, please write us. If you have a look a lines 210 to 230 you will notice that they say repeat line 200. This means to do the same thing as you did in line 200.

Slot Machine screen

10 REM *****************************
20 REM *   SLOT MACHI11LE          *
30 REM *  BY (TOM) TUONG TRAN      *
40 REM *    ROM MAGAZINE           *
50 REM *****************************
60 SETCOLOR 2,16,1
70 DIM V(3),A(16),B(16):POKE 752,1:? "}":SCREEN=PEEK(88)+256*PEEK(89)
80 X=10:FOR D=1 TO 16:READ A,B:A(D)=A:B(D)=B:NEXT D
90 FOR Q=0 TO 24:U=39:D=0:S=-1:IF INT(Q/2)=Q/2 THEN U=0:D=39:S=1
100 FOR W=U TO D STEP S:POKE SCREEN+W+40*Q,128:NEXT W:NEXT Q
110 REM
120 REM ---DRAW-A-SLOT-MACHINE-------
130 REM
140 POKE 85,35:? "50 C↓↓|←←←||↓←||↑↑↑"
150 ? "(4*SP)SPENT";:POKE 85,26:? "EARN"
160 ? "↓(4*SP)$   ";:POKE 85,24:? "$   "
170 ? "↓(4*SP)(CTRL Q)(CTRL R*7)(CTRL W)(CTRL R*7)(CTRL W)(CTRL R*7)(CTRL E)(2*SP)(CTRL T)"
180 ? "(4*SP)|   |   |   |(2*SP)(CTRL B)"
190 ? "(4*SP) | (CTRL N*5) | (CTRL N*5) | (CTRL N*5) |(2*SP)(CTRL B)"
200 ? "(4*SP) |(CTRL Y---Y)|(CTRL Y---Y)|(CTRL Y---Y)|(2*SP)(CTRL Y)"
210 ? "***REPEAT THE SAME AS LINE 200"
220 ? "***REPEAT THE SAME AS LINE 200"
230 ? "***REPEAT THE SAME AS LINE 200"
240 ? "(4*SP)| ((ESC CTRL U*5 |)*3)(2*SP)"
250 ? "(4*SP)|    |    |    |  "
260 ? "(4*SP)(CTRL Z){((CTRL R*7)(CTRL X))*2)(CTRL R*7)(CTRL C)"
270 ? "(4*SP)(CTRL N*25)(3*SP)"
280 ? "(3*SP)(ESC CTRL H)(25SP)(ESC CTRL J)(2*SP)"
290 ? "(3*SP)(CTRL M*27)(2*SP)"
300 POKE 85,8:? "↑SPACE BAR=PLAY:POKE 85,10:? "(Q)KEY=QUIT":POKE 85,10:? "(R)KEY=REPLAY"
310 ? "(↑*15)"
320 POKE 764,255
330 IF IF PEEK(764)=33THEN FOR W=1 TO 10:SOUND 0,l00,l0,10:NEXT W:GOTO 370
340 IF PEEK(764)=47 THEN 540
350 IF PEEK(764)=40 THEN EA=0:SP=0:POKE 85,8:? "(*5)-----";:POKE 85,26:? "-------(*4)":POKE 764,255
360 GOTO 330
370 SOUND 0,0,0,0:SP=SP+0.5:POKE 85,8:? "(↑*5)-----(←*5)";sp;"(*4)":HANDLE=SCREEN+33+40*5:VO=15
380 FOR L=1 TO 6:POKE HANDLE,128:POKE HANDLE+40,212
390 IF INT(L/2)=L/2 THEN GOSUB 520
400 HANDLE=HANDLE+40:NEXT L
410 POKE 85,33:? "↑(INV CTRL T)(((INV CTRL Y))*4)"
420 VO=6:FOR P=1 TO 6:GOSUB 520:NEXT P
430 X=9:N=1:GOSUB 500:X=17:N=2.GOSUB 500:X=25:N=3:GOSUB 500:FOR P=1 TO 20:SOUND 0,10+P*5,10,10:NEXT P.SOUND 0,0,0,0
440 IF V(1)=V(2) AND V(2)=V(3) THEN 590
450 GOTO 320
460 ? "(CTRL Q)(CTRL T)(CTRL Q)(CTRL P)(CTRL E)(INV CTRL J)(1#SP)(INV CTRL H)":RETURN
470 ? " (CTRL T)(CTRL F)(1*SP)(CTRL G)(INV |)(INV |)":RETURN
480 ? "(CTRL Q*3)(CTRL T*3)(CTRL M*3)↑:RETURN
490 ? "(CTRL T)(CTRL F)(1*SP)(CTRL G)(CTRL H)(INV CTRL M)(CTRL J)(INV |)":RETURN
500 POKE 85,X:V(N)=1+INT(RND(0)*4):ON V(N) GOSUB 460,470,480,490
510 RETURN
520 SOUND 0,180,4,VO:FOR Q=1 TO 4:? "(4*SP)|(((CTRL Y)(3*SP)(CTRL Y))*3)|":NEXT Q:? "↑":SOUND 0,0,0,0
530 FOR Q=1 TO 4:? "(4*SP)(|(CTRL Y)---(CTRL Y)|)((CTRL Y)----(CTRL Y)*2)":NEXT Q:? "":RETURN
540 ? "↓   YOU EARN....$";EA
550 ? "↓   YOU SPENT...$";SP
560 IF EA>SP THEN ? "    YOU WIN.....$";EA-SP
570 IF SP>EA THEN ? "    YOU LOSS....$";SP-EA
580 POKE 764,255:POKE 752,0:END
590 REM -GOOD-ONE--------
600 ? "(↓*8)":
610 FOR D=1 TO 16:SOUND 0,B(D),10,10
620 FOR W=1 TO A(D):POKE 85,14:? "LUCKY-YOU";:FOR L=1 TO 5:NEXT L:"? "":NEXT W:NEXT D
630 SOUND 0,0,0,0
640 POKE 85,14:? "  $";5*V(N);:? "*9)":EA=EA+5*V(N):POKE 85,26:? "(*5)←";EA;"↓*4)"
650 GOTO 320
660 REM --SONG-DATA----------------
670 DATA 1,182,3,153,1,153,3,173,1,173,3,204,1,204,3,173,1,173,3,153,1,153,3,204,1,204,3,173,1,153,3,204