Skip to content
Snippets Groups Projects
Commit a94c594b authored by Erwan Jahier's avatar Erwan Jahier
Browse files

maj puzzle arduino

parent 68d82a42
No related branches found
No related tags found
No related merge requests found
......@@ -49,11 +49,11 @@ let
tel
const led1_0 = Eteint;
const led2_0 = Allume;
const led3_0 = Eteint;
const led4_0 = Allume;
const led5_0 = Eteint;
const led1_000 = Eteint;
const led2_000 = Allume;
const led3_000 = Eteint;
const led4_000 = Allume;
const led5_000 = Eteint;
----------------------------------------------------------------------------
-- blue => permutation circulaire
-- red => inverse une led qui circule a chaque pression de boutons
......@@ -72,15 +72,15 @@ let
)
else (pre X1, pre X2, pre X3, pre X4, pre X5);
led1 = led1_0 -> if blue then pre(led5) else
led1 = led1_000 -> if blue then pre(led5) else
if red and X1 then not(pre(led1)) else pre(led1);
led2 = led2_0 -> if blue then pre(led1) else
led2 = led2_000 -> if blue then pre(led1) else
if red and X2 then not(pre(led2)) else pre(led2);
led3 = led3_0 -> if blue then pre(led2) else
led3 = led3_000 -> if blue then pre(led2) else
if red and X3 then not(pre(led3)) else pre(led3);
led4 = led4_0 -> if blue then pre(led3) else
led4 = led4_000 -> if blue then pre(led3) else
if red and X4 then not(pre(led4)) else pre(led4);
led5 = led5_0 -> if blue then pre(led4) else
led5 = led5_000 -> if blue then pre(led4) else
if red and X5 then not(pre(led5)) else pre(led5);
tel
......@@ -130,11 +130,11 @@ tel
-- red => la led courante devient le and des leds autours
-- la led courante est le premiere au debut, puis la deuxieme, etc.
const led1_p5 = F;
const led1_p5 = T;
const led2_p5 = F;
const led3_p5 = F;
const led4_p5 = T;
const led5_p5 = F;
const led3_p5 = T;
const led4_p5 = F;
const led5_p5 = T;
node puzzle5(red,blue:bool)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment