Monty Hall problem: Difference between revisions
m
→{{header|True BASIC}}
Line 924:
==={{header|True BASIC}}===
<syntaxhighlight lang="
DIM puertas(3)
LET numTiradas = 1000000
FOR i =
LET pta_coche = INT(RND * 3) + 1
LET puertas(pta_coche) = 1
LET pta_elegida = INT(RND * 3) + 1
LET pta_montys =
LOOP WHILE puertas(pta_montys) = 1 OR pta_montys = pta_elegida
IF puertas(pta_elegida) = 1 THEN
ELSE
▲ DO
▲ LET pta_montys = INT(RND * 3) + 1
END IF
LET puertas(pta_coche) = 0
▲ IF pta_coche = pta_elegida THEN LET permanece = permanece + 1
NEXT i
PRINT "Cambiar gana el"; permanece / numTiradas * 100; "% de las veces."
PRINT "Mantenerse gana el"; cambia / numTiradas * 100; "% de las veces."
END</syntaxhighlight>▼
▲</syntaxhighlight>
==={{header|Yabasic}}===
|