15 mit 3

Tabletop - Dice🇩🇪 1985
Requires BASIC
AtariMania
Here you have to form the Numbers 1 to 15 by linking 3 diced Numbers with the 4 basic calculations (plus, minus, times, divide).

First, the Number of Players, then the Time Limit and The Player names are entered. When Entering Time: 0-long time and 10 short time.

The Dice Number is the number the player must make. For This purpose, the Dice 1-3 are available to him. The Combination is entered as follows: WN RA WN RA WN. The Same Corresponds TO WN's Cube Number and RA to the Type of calculation. If the Player fails to reach the Dice Number, he tries to form a Number that is close to the Dice number, because the Penalty Points are given when the Time limit has been exceeded or the Combination result has a Res (E.g. 5/4 = 1.25). When Entering the Combination, it is important to ensure that def Computers calculate the Terms from left to right. So The Point-before line rule does not apply. As soon as the Penalty Points are issued by the Computer, the following is possible:

  1. Press start, the next player can play.
  2. Press Select to go to the game entries.
  3. Press Option to list the table of a player's penalty points.
  4. Press Help to run the computer. He then shows his best solution. However, for old Ataris this function is achieved by simultaneously pressing OPTION and SELECT.
Program Listing
For fans of type-ins I have reproduced the listing below. If you used to read Antic or Page 6 back in the day you'll probably recognise the TYPO II/III checksum codes on the left side of the listing which you can use to check your typing as you go. The code word-wraps to the screen width but each line starting with a TYPO code and line number should be typed as a single line.
GA
0
POKE 559,0
TO
1
DIM W((3),WW((3),E((5),Z1$(1),Z2$(1),K1((6),K2((6),K3((6),SU((96),P((96,5),PZ((25),NAME$(250),N$(10),SSS((25,15)
BW
2
WW((1)=3:WW((2)=16:WW((3)=29:DIM PL((25),GW((25)
IR
3
DATA 1,2,3,2,3,1,3,1,2,1,3,2,2,1,3,3,2,1
PQ
9
RESTORE 2:FOR I=1 TO 6:READ A,B,C:K1((I)=A:K2((I)=B:K3((I)=C:NEXT I
XR
10
GRAPHICS 0:POKE 559,0:GOSUB 30000
TL
20
POKE 752,1:? CHR$(125):POKE 712,129:POKE 710,129:POKE 709,14:POKE 708,196:POKE 711,0
GX
30
POKE DL+16,130:POKE 54286,192
RR
40
FOR I=DL+6 TO DL+9:POKE I,6:NEXT I:POKE 82,0
QT
100
POKE 559,34
LI
101
GOTO 15000
WV
105
POSITION 2,0:? "F U N K Y S O F T P R E S E N T S"
EZ
110
POSITION 2,2:? "*** 15  3 ***"
DX
120
POSITION 2,3:? "1.WUERFEL 2.WUERFEL 3.WUERFEL"
RF
199
REM SPIELSTART
KM
200
Z=Z+1:IF Z>15 THEN GOSUB 25000:GOTO 15000
WH
210
FOR SPS=1 TO AN
RT
220
GOSUB 8000:POSITION 2,20:? "SPIELERNAME : ";NAME$((SPS-1)*10+1,(SPS-1)*10+10)
GB
222
GOSUB 7500:GOSUB 7000
LY
225
POKE 19,ZT:POKE 18,0
PF
240
POSITION 2,13:? "WUERFELZAHL : ";Z
ZM
250
POSITION 2,15:? "KOMBINATION : "
AV
260
POSITION 2,17:? "STRAFPUNKTE : "
II
270
GOSUB 8500:GOSUB 9000
AY
280
IF T=0 THEN 270
SC
300
GOSUB 10000
DE
400
SSS((SPS,Z)=SP
XF
990
POSITION 2,20:? "BITTE DIE  DRUECKEN !!!"
XI
995
IF PEEK(732)=17 OR PEEK(53279)=1 THEN GOSUB 12000:POKE 732,0:GOTO 990
YD
996
IF PEEK(53279)=3 THEN GOSUB 20000:GOTO 999
LF
997
IF PEEK(53279)=5 THEN POP :GOTO 15000
RA
998
IF PEEK(53279)<>6 THEN 995
SG
999
NEXT SPS:GOTO 200
SS
1000
? "":POSITION AB,6
ON
1001
? " ":POSITION AB,7
PV
1002
? " ":POSITION AB,8
YF
1003
? "  ":POSITION AB,9
NH
1004
? " ":POSITION AB,10
OQ
1005
? " ":POSITION AB,11
OI
1006
? ""
BB
1007
RETURN
ST
2000
? "":POSITION AB,6
LU
2001
? " ":POSITION AB,7
PW
2002
? " ":POSITION AB,8
RE
2003
? " ":POSITION AB,9
NI
2004
? " ":POSITION AB,10
FP
2005
? " ":POSITION AB,11
OJ
2006
? ""
BC
2007
RETURN
ZU
2200
GOSUB 8000
SU
3000
? "":POSITION AB,6
LV
3001
? " ":POSITION AB,7
PX
3002
? " ":POSITION AB,8
YH
3003
? "  ":POSITION AB,9
NJ
3004
? " ":POSITION AB,10
FQ
3005
? " ":POSITION AB,11
OK
3006
? ""
BD
3007
RETURN
SV
4000
? "":POSITION AB,6
CU
4001
? " ":POSITION AB,7
PY
4002
? " ":POSITION AB,8
RG
4003
? " ":POSITION AB,9
NK
4004
? " ":POSITION AB,10
CX
4005
? " ":POSITION AB,11
OL
4006
? ""
BE
4007
RETURN
SW
5000
? "":POSITION AB,6
CV
5001
? " ":POSITION AB,7
PZ
5002
? " ":POSITION AB,8
YJ
5003
? "  ":POSITION AB,9
NL
5004
? " ":POSITION AB,10
CY
5005
? " ":POSITION AB,11
OM
5006
? ""
BF
5007
RETURN
SX
6000
? "":POSITION AB,6
CW
6001
? " ":POSITION AB,7
QA
6002
? " ":POSITION AB,8
FM
6003
? " ":POSITION AB,9
NM
6004
? " ":POSITION AB,10
CZ
6005
? " ":POSITION AB,11
ON
6006
? ""
BG
6007
RETURN
RF
7000
REM WUERFEL PRINTEN
XC
7010
FOR I=1 TO 3
AF
7020
AB=WW((I)
ZG
7030
POSITION AB,5
VE
7040
ON W((I) GOSUB 1000,2000,3000,4000,5000,6000
FK
7050
NEXT I
AX
7060
RETURN
ZC
7500
REM WUERFELN
XM
7510
FOR I=1 TO 3
MH
7520
W((I)=INT(6*RND(0)+1)
FO
7530
NEXT I
BB
7540
RETURN
OH
8000
REM LOESCHEN
YU
8005
COLOR 32
WO
8010
FOR I=20 TO 5 STEP -1:PLOT 0,I:DRAWTO 39,I:NEXT I
AM
8020
RETURN
FK
8500
REM EINGABE DER KOMBINATION
IE
8510
CLOSE #1:OPEN #1,4,0,"K:"
YY
8520
FOR I=1 TO 5
MB
8530
GET #1,T
TH
8535
IF (T<49 OR T>51) AND T<>42 AND T<>43 AND T<>45 AND T<>47 THEN 8530
OK
8540
E((I)=T
PK
8550
POSITION I+15,15:? CHR$(T)
FY
8560
NEXT I
BL
8570
RETURN
TW
9000
REM EINGABEKONTROLLE
XR
9010
T=0
ME
9020
FOR I=1 TO 5:AB=E((I)
FK
9030
IF AB>48 AND AB<52 THEN T=T+AB-48
UT
9040
IF I=1 AND I=3 AND I=5 THEN IF NOT AB>48 AND AB<52 THEN 9200
AX
9050
IF I<>1 AND I<>3 AND I<>5 THEN IF AB>48 AND AB<52 THEN 9200
EZ
9100
NEXT I
BF
9110
IF T=6 THEN RETURN
YU
9111
REM FEHLER IN DER EINGABE
YN
9200
FOR I=1 TO 5
QD
9210
POSITION 16,15:? "FEHLER !!!"
HM
9220
? CHR$(253)
US
9230
POSITION 16,15:? " "
FN
9240
NEXT I
PN
9250
T=0:RETURN
IA
10000
REM STRAFPUNKTE ERRECHNEN
NK
10010
S1=W((E((1)-48):S2=W((E((3)-48):S3=W((E((5)-48)
IV
10015
TT=PEEK(19)
UP
10020
Z1$=CHR$(E((2)):Z2$=CHR$(E((4))
PB
10030
IF Z1$="+" THEN ER=S1+S2
SN
10040
IF Z1$="-" THEN ER=S1-S2
NS
10050
IF Z1$="*" THEN ER=S1*S2
WD
10060
IF Z1$="/" THEN ER=S1/S2
ZN
10070
IF Z2$="+" THEN EE=ER+S3
CZ
10080
IF Z2$="-" THEN EE=ER-S3
YE
10090
IF Z2$="*" THEN EE=ER*S3
FE
10100
IF Z2$="/" THEN EE=ER/S3
RZ
10101
SP=0
ZV
10105
IF EE<>INT(EE) THEN SP=SP+5
UY
10107
IF TT>11 OR PEEK(18)>0 THEN SP=SP+5:POSITION 24,17:? "ZEITLIMIT !!!"
FS
10110
SP=SP+INT(ABS(EE-Z))
JL
10120
POSITION 16,17:? SP
AL
10130
PZ((SPS)=PZ((SPS)+SP
DL
11111
RETURN
XK
12000
REM KOMBINATION MIT COMPUTER
YK
12001
DATA +,+,+,-,+,*,+,/
ED
12002
DATA -,+,-,-,-,*,-,/
WA
12003
DATA *,+,*,-,*,*,*,/
KB
12004
DATA /,+,/,-,/,*,/,/
QG
12005
T=0
AI
12006
POSITION 2,20:? "BITTE WARTEN - ICH KOMBINIERE !!!"
YN
12010
FOR I=1 TO 6:RESTORE 12001:FOR II=1 TO 16
NI
12020
T=T+1
BB
12030
READ Z1$,Z2$
BS
12035
SUS=0
SY
12040
IF Z1$="+" THEN ER=W((K1((I))+W((K2((I))
XA
12050
IF Z1$="-" THEN ER=W((K1((I))-W((K2((I))
RH
12060
IF Z1$="*" THEN ER=W((K1((I))*W((K2((I))
BG
12070
IF Z1$="/" THEN ER=W((K1((I))/W((K2((I))
BV
12080
IF Z2$="+" THEN EE=ER+W((K3((I))
FH
12090
IF Z2$="-" THEN EE=ER-W((K3((I))
ZB
12100
IF Z2$="*" THEN EE=ER*W((K3((I))
HM
12110
IF Z2$="/" THEN EE=ER/W((K3((I))
QU
12120
IF EE<>INT(EE) THEN SUS=SUS+5
PE
12122
P((T,1)=K1((I)+48:P((T,3)=K2((I)+48:P((T,5)=K3((I)+48
BU
12124
P((T,2)=ASC(Z1$):P((T,4)=ASC(Z2$)
UG
12130
IF EE<>Z THEN SUS=SUS+INT(ABS(EE-Z))
YH
12140
SU((T)=SUS:NEXT II:NEXT I
LG
12221
REM AUSWERTUNG DER 96 KOMBINATIONEN
UE
12222
T=99999:FOR I=1 TO 96
EQ
12223
AB=SU((I)
KJ
12230
IF AB<T THEN T=AB:KOM=I
HE
12235
NEXT I
DI
12240
POSITION 16,15:FOR I=1 TO 5:? CHR$(P((KOM,I));:NEXT I
HQ
12245
? " MIT HELP"
HT
12250
POSITION 16,17:? SU((KOM);
LI
12252
IF SU((KOM)<10 THEN ? " MIT HELP "
JA
12254
IF SU((KOM)>9 THEN ? " MIT HELP "
KQ
12256
IF SU((KOM)>99 THEN ? " MIT HELP "
NF
12258
IF SU((KOM)>999 THEN ? " MIT HELP "
EF
12260
RETURN
JK
14999
REM ANZAHL , NAMEN , ZEIT
YR
15000
? CHR$(125):Z=0:FOR I=1 TO 25:PZ((I)=0:NEXT I
ET
15001
NAME$=" ":NAME$(250)=NAME$:NAME$(2)=NAME$
QJ
15002
N$=" ":N$(10)=N$:N$(2)=N$
VK
15003
POSITION 1,1:? "SPIELEINTRAGUNGEN"
VZ
15010
FOR I=1 TO 25:FOR II=1 TO 15:SSS((I,II)=0:NEXT II:NEXT I
SN
15020
POSITION 2,5:? "ANZAHL DER SPIELER (1-25) : "
PK
15030
POSITION 2,8:? "ZEITLIMIT (0-10) : "
XU
15035
TRAP 15000
XJ
15040
POSITION 30,5:INPUT AN:IF AN<1 OR AN>25 THEN 15000
XY
15045
TRAP 15000
FC
15050
POSITION 30,8:INPUT ZT:IF ZT<0 OR ZT>10 THEN 15000
ZB
15060
FOR I=1 TO AN
ZM
15070
POSITION 2,15:? I;".NAME : ";
PQ
15090
INPUT N$
HP
15100
NAME$((I-1)*10+1,(I-1)*10+10)=N$
LR
15105
POSITION 2,15:? " "
PP
15110
NEXT I:T=1
RI
15120
POSITION 2,20:? "BITTE DIE  DRUECKEN !!!"
NV
15130
T=T+0.1:IF T>AN+0.9 THEN T=1
JJ
15135
TT=INT(T)
RZ
15140
POSITION 2,15:? TT;".NAME : ";NAME$((TT-1)*10+1,(TT-1)*10+10)
BA
15500
IF PEEK(53279)<>6 THEN 15130
HR
15555
? CHR$(125):GOTO 105
MN
20000
REM TABELLE PRINTEN
HY
20010
GOSUB 8000
JQ
20020
POSITION 2,5:? "WELCHE TABELLE ???"
JR
20025
POSITION 2,7:? "SPIELERNAME : ";:INPUT N$
KJ
20027
TT=LEN(N$):IF TT=0 THEN 20025
YG
20030
FOR I=1 TO AN
XU
20035
IF N$=NAME$((I-1)*10+1,(I-1)*10+TT) THEN POP :GOTO 20050
HC
20040
NEXT I:GOSUB 8000:RETURN
PA
20050
REM NAME GEFUNDEN
EO
20055
TT=I
KY
20060
GOSUB 8000:POSITION 2,5:? "AUSGABEFORMAT : ZAHL - PUNKTE"
DK
20070
POSITION 2,7:? "TABELLENNAME : ";N$
NU
20080
FOR I=1 TO 8
UJ
20090
POSITION 2,8+I:? I;" - ";SSS((TT,I)
OA
20092
NEXT I:POSITION 25,9:? "9 - ";SSS((TT,9)
XW
20100
FOR I=10 TO 15:POSITION 24,I:? I;" - ";SSS((TT,I):NEXT I
KG
20110
POSITION 21,16:? "SUMME - ";PZ((TT)
RG
22220
POSITION 2,20:? "BITTE DIE  DRUECKEN !!!"
ZV
22221
IF PEEK(53279)<>6 THEN 22221
EA
22222
RETURN
JP
25000
REM SIEGERTABELLE
NJ
25010
? CHR$(125)
PM
25020
POSITION 3,1:? "SIEGERTABELLE"
JG
25030
POSITION 6,5:? "NAME : STRAFPUNKTE"
QN
25040
T=1
RS
25050
POSITION 2,20:? "BITTE DIE  DRUECKEN !!!"
IT
25060
T=9999:FOR I=1 TO AN:IF PZ((I)<T THEN T=PZ((I):AB=I
GW
25070
NEXT I
RL
25075
AW=0
WL
25080
FOR I=1 TO AN:IF PZ((I)=T THEN AW=AW+1:GW((AW)=I
HE
25090
NEXT I
SR
25099
T=0
VL
25100
T=T+1:POSITION 6,10:? NAME$((T-1)*10+1,(T-1)*10+10)
FC
25110
POSITION 17,10:? ": ";PZ((T);" "
AQ
25120
FOR II=1 TO AW:AB=GW((II)
SO
25125
FOR I=1 TO 10
TH
25130
POSITION 6,15:? "GEWINNER : ";NAME$((AB-1)*10+1,(AB-1)*10+10)
FT
25140
POSITION 6,15:? " "
AS
25145
IF PEEK(53279)=6 THEN RETURN
HW
25147
NEXT I
RE
25150
NEXT II
FH
25550
IF T=AN THEN T=0
BM
25555
GOTO 25100
ZV
30000
REM MC FUER DISPLAYLIST-INTERRUPT
GW
30005
RESTORE 30010
BX
30010
DATA 72,238,196,2,238,199,2,104,64
NG
30020
FOR I=1536 TO 1544:READ D:POKE I,D:NEXT I
KX
30030
DL=PEEK(560)+256*PEEK(561)
SN
30040
POKE 512,0
WX
30050
POKE 513,6
DD
32000
RETURN