8-Bit Software Online Conversion

Pay Dutch Coins - Listing

10 REM PAY WITH DUTCH COINS 20 REM By Ch.W.Brederode, Lisse 30 REM This is Public Domain 40 MODE1:HIMEM=&2CA0:*LOAD MUNTEN 50 CLS:PRINTTAB(0,6)"PAY WITH DUTCH C OINS" 60 PRINT'"The computer shows an amoun t to pay"''"at the bottom of the screen. " 70 PRINT'"With the UP/DOWN CURSOR-KEY S you can"''"select and" 80 PRINT'"with the LEFT/RIGHT CURSOR- KEYS you can"''"put down or take away th e coins." 90 PRINT'"(You may use the SPACE-BAR and DELETE"''"as well)" 100 PRINT'"When finished - press RETUR N "; 110 REPEATUNTILGET=13 120 DIM W%(5),T%(5) 130 P%=HIMEM:S%=&3000 140 VDU23,1,0;0;0;0; 150 CLS:SC=&3500 160 X=RND(-TIME) 170 : 180 FORN=0 TO 5:READ D$,D:W%(N)=D:T%(N )=0:PRINTTAB(33,3+N*4)"F. "+D$:NEXT 190 DATA"O,O5",5,"O,1O",10,"O,25",25," 1,OO",100,"2,5O",250,"5,OO",500 200 : 210 maximum%=8400 :REM <<<<<<<< MAXIM UM AMOUNT can NOT be higher than 8400 220 MX%=INT(maximum% DIV5) 230 F%=RND(MX%)*5:F1$=STR$(F%):L=LEN(F 1$):IF L<3 THEN F1$=RIGHT$("00"+F1$,3):L =3 240 F$=LEFT$(F1$,L-2)+","+RIGHT$(F1$,2 ) 250 PROCo(F$) 260 PRINTTAB(0,28)"PAY F. "+F2$ 270 : 280 TT=0:Y%=0:OY=0:*FX4,1 290 PRINTTAB(31,3+OY*4)" ":PRINTTAB(31 ,3+Y%*4)">":OY=Y% 300 Q=GET 310 IF Q=138 THEN Y%=(Y%+1)MOD6:GOTO29 0 320 IF Q=139 THEN Y%=(Y%+5)MOD6:GOTO29 0 330 IF(Q=136 OR Q=32)AND T%(Y%)<10 THE N G%=T%(Y%):PROCmunt(Y%,G%):T%(Y%)=T%(Y% )+1:TT=TT+W%(Y%) 340 IF(Q=137 OR Q=127)AND T%(Y%)>0 THE N T%(Y%)=T%(Y%)-1:G%=T%(Y%):TT=TT-W%(Y%) :PRINTTAB(G%*3,2+Y%*4)" ";:VDU10,127,1 27,127,10,32,32,32 350 IF Q=13 THEN380 360 GOTO290 370 : 380 *FX4 390 IF TT=F% THEN PRINTTAB(17,28)"RIGH T":GOTO430 400 F1$=STR$(TT):L=LEN(F1$):IF L<3 THE N F1$=RIGHT$("00"+F1$,3):L=3 410 F$=LEFT$(F1$,L-2)+","+RIGHT$(F1$,2 ):PROCo(F$) 420 PRINTTAB(17,28)"WRONG, THIS IS F. "+F2$ 430 PRINTTAB(17,30)"ONCE MORE?"; 440 Q$=GET$:Q=INSTR("YyJjNn",Q$):IF Q= 0 THEN440 450 IF Q<5 THEN RESTORE:CLS:GOTO180 460 MODE7:END 470 : 480 DEFPROCmunt(Y%,G%) 490 S%=&3500+G%*48+Y%*&A00:P%=HIMEM+Y% *144 500 FORN%=0 TO 2:FOR B%=0 TO 47 510 ?(S%+B%)=?(P%+B%):NEXT 520 P%=P%+48:S%=S%+&280:NEXT 530 ENDPROC 540 : 550 DEFPROCo(F$) 560 F2$="":FOR N=1 TO LEN(F$) 570 Q$=MID$(F$,N,1):IF Q$="0"THEN Q$=" O" 580 F2$=F2$+Q$:NEXT 590 ENDPROC