Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed May 22, 2023
1 parent 30985f2 commit 304efde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions data/scenarios/Challenges/_lights-out/assistant.sw
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,18 @@ def togglePending = \state.
case maybePending return $ flipSelfAndNeighbors state;
end;

def observe = \boardWidth. \boardHeight.
def observe =
instant (
togglePending "on";
togglePending "off";
);
observe boardWidth boardHeight;

// Without this 'wait' call, we may end up doing the instant call
// multiple times in one tick, until it uses up its step allotment.
// We really only want the 'observe' function to execute once per tick.
wait 1;

observe;
end;

def makeOnIf = \b.
Expand Down Expand Up @@ -263,7 +269,7 @@ def go =
let boardWidth = 5 in
let boardHeight = 5 in
instant $ generateGame boardWidth boardHeight;
observe boardWidth boardHeight;
observe;
end;

go;
2 changes: 1 addition & 1 deletion test/integration/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ testScenarioSolution _ci _em =
, testSolution (Sec 5) "Challenges/gopher"
, testSolution (Sec 5) "Challenges/hackman"
, testSolution (Sec 10) "Challenges/hanoi"
, testSolution (Sec 3) "Challenges/lights-out"
, testSolution Default "Challenges/lights-out"
, testSolution Default "Challenges/friend"
, testGroup
"Mazes"
Expand Down

0 comments on commit 304efde

Please sign in to comment.