Así:
Código:
Escena 1
actions for fotograma 1
// SitIni.
Base.S = 10;
// Guardar SitIni.
SitID = "S"+Base.S;
Depth = 1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", Base.S);
set (SitID+".C", "Ninguno");
// Cand normal.
C = 1;
// Vars de Unsolved sits.
U = 0;
Us = 0;
actions for fotograma 2
// Reset Sit. Aplic.
S = Base.S+C;
// ¿Sol?
if (20<S) {
// Sol; begin to show list
List = C;
gotoAndPlay (4);
// Sino ¿la sit está anotada?
} else if (eval("S"+S+".S") == undefined) {
// No. Anotarla.
SitID = "S"+S;
Depth = Depth+1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", Base.S);
set (SitID+".C", C);
Us = Us+1;
SitID = "U"+Us;
Depth = Depth+1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", S);
}
actions for fotograma 3
// La sit existe. ¿Candmod is pos?
if (C<2) {
// Candmod.
C = C+1;
gotoAndPlay (2);
} else if (U < Us) {
// Use Uns.
U = U+1;
Base.S = eval("U"+U+".S");
C = 1;
gotoAndPlay (2);
} else {
// No hay Sol.
stop ();
}
actions for fotograma 5
SitID = eval("S"+Base.S+".C");
Base.S = eval("S"+Base.S+".S");
if (SitID != "Ninguno") {
List = List+" "+SitID;
gotoAndPlay (4);
} else {
stop ();
}
El pseudocódigo sería más o menos así:actions for fotograma 1
// SitIni.
Base.S = 10;
// Guardar SitIni.
SitID = "S"+Base.S;
Depth = 1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", Base.S);
set (SitID+".C", "Ninguno");
// Cand normal.
C = 1;
// Vars de Unsolved sits.
U = 0;
Us = 0;
actions for fotograma 2
// Reset Sit. Aplic.
S = Base.S+C;
// ¿Sol?
if (20<S) {
// Sol; begin to show list
List = C;
gotoAndPlay (4);
// Sino ¿la sit está anotada?
} else if (eval("S"+S+".S") == undefined) {
// No. Anotarla.
SitID = "S"+S;
Depth = Depth+1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", Base.S);
set (SitID+".C", C);
Us = Us+1;
SitID = "U"+Us;
Depth = Depth+1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", S);
}
actions for fotograma 3
// La sit existe. ¿Candmod is pos?
if (C<2) {
// Candmod.
C = C+1;
gotoAndPlay (2);
} else if (U < Us) {
// Use Uns.
U = U+1;
Base.S = eval("U"+U+".S");
C = 1;
gotoAndPlay (2);
} else {
// No hay Sol.
stop ();
}
actions for fotograma 5
SitID = eval("S"+Base.S+".C");
Base.S = eval("S"+Base.S+".S");
if (SitID != "Ninguno") {
List = List+" "+SitID;
gotoAndPlay (4);
} else {
stop ();
}
Parte 1:
- Establecer situación inicial.
- Establecer valor inicial del candidato.
- Establecer situaciones halladas.
- Establecer situaciones analizadas.
...
Obviamente sigue pero no tengo ganas de pensar cómo describirlo humanamente. El candidato varía, las situaciones nuevas se analizan aplicándoles diferentes candidatos...
Cuando hay pistas, habría que ver el tipo de pista ¿cuales son posibles?
- Parecido de un valor. "Más" o "menos".
- Parecido de parte de un valor. Una forma de esto es lo que se hace en MasterMind.
- Parecido de la suma de las partes de un valor.
...son muchos imagino. Por ahora me interesa la 1, la más típica.
Otro punto relevante es si son suficientes o insuficientes. Empezaré por las suficientes.
Lo intenté...
Código:
Escena 1
actions for fotograma 1
// SitIni.
Base.S = 10;
// Guardar SitIni.
SitID = "S"+Base.S;
Depth = 1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", Base.S);
set (SitID+".C", "Ninguno");
// Cand normal.
C = 1;
// Vars de Unsolved sits.
U = 0;
Us = 0;
Pista = "";
actions for fotograma 2
// Reset Sit.
S = Base.S;
// Mod de Aplic, basado en pistas.
if (Pista == 2) {
C = 2;
}
// Aplic
S = S+C;
// ¿Sol?
if (20<S) {
// Sol; begin to show list
List = C;
gotoAndPlay (4);
} else {
// sino se dan pistas si es posible
if (20<=S) {
Pista = 2;
} else {
Pista = "";
}
// ¿La sit está anotada?
if (eval("S"+S+".S") == undefined) {
// No. Anotarla.
SitID = "S"+S;
Depth = Depth+1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", Base.S);
set (SitID+".C", C);
Us = Us+1;
SitID = "U"+Us;
Depth = Depth+1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", S);
}
}
actions for fotograma 3
// La sit existe. ¿Candmod is pos?
if (C<2) {
// Candmod.
C = C+1;
gotoAndPlay (2);
} else if (U<Us) {
// Use Uns.
U = U+1;
Base.S = eval("U"+U+".S");
C = 1;
gotoAndPlay (2);
} else {
// No hay Sol.
stop ();
}
actions for fotograma 5
SitID = eval("S"+Base.S+".C");
Base.S = eval("S"+Base.S+".S");
if (SitID != "Ninguno") {
List = List+" "+SitID;
gotoAndPlay (4);
} else {
stop ();
}
...pero las pistas siempre deberían ser "2" y no obstante el programa en el último caso elige "1".actions for fotograma 1
// SitIni.
Base.S = 10;
// Guardar SitIni.
SitID = "S"+Base.S;
Depth = 1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", Base.S);
set (SitID+".C", "Ninguno");
// Cand normal.
C = 1;
// Vars de Unsolved sits.
U = 0;
Us = 0;
Pista = "";
actions for fotograma 2
// Reset Sit.
S = Base.S;
// Mod de Aplic, basado en pistas.
if (Pista == 2) {
C = 2;
}
// Aplic
S = S+C;
// ¿Sol?
if (20<S) {
// Sol; begin to show list
List = C;
gotoAndPlay (4);
} else {
// sino se dan pistas si es posible
if (20<=S) {
Pista = 2;
} else {
Pista = "";
}
// ¿La sit está anotada?
if (eval("S"+S+".S") == undefined) {
// No. Anotarla.
SitID = "S"+S;
Depth = Depth+1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", Base.S);
set (SitID+".C", C);
Us = Us+1;
SitID = "U"+Us;
Depth = Depth+1;
attachMovie("Circ", SitID, Depth);
setProperty (SitID, _x, random(401));
setProperty (SitID, _y, random(301));
set (SitID+".S", S);
}
}
actions for fotograma 3
// La sit existe. ¿Candmod is pos?
if (C<2) {
// Candmod.
C = C+1;
gotoAndPlay (2);
} else if (U<Us) {
// Use Uns.
U = U+1;
Base.S = eval("U"+U+".S");
C = 1;
gotoAndPlay (2);
} else {
// No hay Sol.
stop ();
}
actions for fotograma 5
SitID = eval("S"+Base.S+".C");
Base.S = eval("S"+Base.S+".S");
if (SitID != "Ninguno") {
List = List+" "+SitID;
gotoAndPlay (4);
} else {
stop ();
}
Es un programa de posicionarse en un casillero que inicialmente es mayor al objeto que se posiciona.
¿Cual es la falla?