|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
function createGame1(){
|
|
|
|
|
function createGame1() {
|
|
|
|
|
|
|
|
|
|
timeEnd = 20;
|
|
|
|
|
|
|
|
|
@ -11,12 +11,12 @@ function createGame1(){
|
|
|
|
|
createSwitch("s5", 20, 700);
|
|
|
|
|
createSwitch("s6", 20, 600);
|
|
|
|
|
createSwitch("s7", 350, 600);
|
|
|
|
|
|
|
|
|
|
createLogique(200, 100, "logique1","et");
|
|
|
|
|
createLogique(300,200,"logique2","nonou");
|
|
|
|
|
createLogique(500,300,"logique3","et");
|
|
|
|
|
createLogique(500,400,"logique4","etnon");
|
|
|
|
|
createLogique(500,500,"logique5","inv");
|
|
|
|
|
|
|
|
|
|
createLogique(200, 100, "logique1", "et");
|
|
|
|
|
createLogique(300, 200, "logique2", "nonou");
|
|
|
|
|
createLogique(500, 300, "logique3", "et");
|
|
|
|
|
createLogique(500, 400, "logique4", "etnon");
|
|
|
|
|
createLogique(500, 500, "logique5", "inv");
|
|
|
|
|
|
|
|
|
|
createLink(stage.findOne("#s7"), findLogique("logique5"));
|
|
|
|
|
createLink(stage.findOne("#s5"), findLogique("logique4"));
|
|
|
|
@ -24,14 +24,14 @@ function createGame1(){
|
|
|
|
|
createLink(stage.findOne("#s3"), findLogique("logique2"));
|
|
|
|
|
createLink(stage.findOne("#s2"), findLogique("logique1"));
|
|
|
|
|
createLink(stage.findOne("#s1"), findLogique("logique1"));
|
|
|
|
|
createLink(findLogique("logique1"),findLogique("logique2"));
|
|
|
|
|
createLink(findLogique("logique1"), findLogique("logique2"));
|
|
|
|
|
createLink(stage.findOne("#s4"), findLogique("logique3"));
|
|
|
|
|
createLink(findLogique("logique2"),findLogique("logique3"));
|
|
|
|
|
createLink(findLogique("logique2"), findLogique("logique3"));
|
|
|
|
|
initAllSwitch();
|
|
|
|
|
createEnd(800, 320);
|
|
|
|
|
initEnd();
|
|
|
|
|
}
|
|
|
|
|
function createGame2(){
|
|
|
|
|
function createGame2() {
|
|
|
|
|
|
|
|
|
|
timeEnd = 40;
|
|
|
|
|
|
|
|
|
@ -45,19 +45,64 @@ function createGame2(){
|
|
|
|
|
insertLogiqueColonne("logique4", "etnon", 2);
|
|
|
|
|
insertLogiqueColonne("logique5", "inv", 2);
|
|
|
|
|
|
|
|
|
|
createLink(findLogique("logique1"),findLogique("logique2"));
|
|
|
|
|
createLink(findLogique("logique2"),findLogique("logique3"));
|
|
|
|
|
createLink(findLogique("logique1"), findLogique("logique2"));
|
|
|
|
|
createLink(findLogique("logique2"), findLogique("logique3"));
|
|
|
|
|
|
|
|
|
|
createAllLinkSwitch();
|
|
|
|
|
|
|
|
|
|
initAllSwitch();
|
|
|
|
|
createEnd();
|
|
|
|
|
initEnd();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function generatorGame() {
|
|
|
|
|
|
|
|
|
|
timeEnd = getRandomArbitrary(15, 50);
|
|
|
|
|
|
|
|
|
|
initTimer();
|
|
|
|
|
|
|
|
|
|
var logiqueCount = 0;
|
|
|
|
|
|
|
|
|
|
colonneTot = getRandomArbitrary(2, 3);
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < colonneTot; i++) {
|
|
|
|
|
liveColonneNumber.push([]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < colonneTot; i++) {
|
|
|
|
|
numberPerColonne[i] = getRandomArbitrary(2, 4);
|
|
|
|
|
for (let j = 0; j < numberPerColonne[i]; j++) {
|
|
|
|
|
logiqueCount++;
|
|
|
|
|
let type = null;
|
|
|
|
|
switch (getRandomArbitrary(0, 4)) {
|
|
|
|
|
case 0:
|
|
|
|
|
type = "et";
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
type = "ou";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
type = "etnon";
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
type = "nonou";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
insertLogiqueColonne("logique" + logiqueCount, type, i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logiques.forEach(function (element) {
|
|
|
|
|
createLinkAuto(element.name);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
calculNombreSwitch();
|
|
|
|
|
switchCreator(numberOfSwitch);
|
|
|
|
|
|
|
|
|
|
createAllLinkSwitch();
|
|
|
|
|
|
|
|
|
|
/*createLink(stage.findOne("#s7"), findLogique("logique5"));
|
|
|
|
|
createLink(stage.findOne("#s5"), findLogique("logique4"));
|
|
|
|
|
createLink(stage.findOne("#s6"), findLogique("logique4"));
|
|
|
|
|
createLink(stage.findOne("#s3"), findLogique("logique2"));
|
|
|
|
|
createLink(stage.findOne("#s2"), findLogique("logique1"));
|
|
|
|
|
createLink(stage.findOne("#s1"), findLogique("logique1"));
|
|
|
|
|
createLink(stage.findOne("#s4"), findLogique("logique3"));*/
|
|
|
|
|
initAllSwitch();
|
|
|
|
|
createEnd();
|
|
|
|
|
initEnd();
|
|
|
|
|
|
|
|
|
|
}
|