-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More logic factors, check for duplicate nodes, network info text (#66)
* check for duplicate node names, improve error handling * split up logic code * make logic factor pointer interface * add weekday puzzle * add counting and indexing logic * rename logic index to given * add logic for indices * add new examples to CI * rename logic index to outcome * add more counting logic * add more outcome logic * add friends example * networks can have an intro text
- Loading branch information
Showing
25 changed files
with
1,190 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Who is right? | ||
info: >- | ||
Four friends A, B, C and D meet and state the quoted facts below. | ||
Who is right, and who is wrong? | ||
Activate the ==> in the blue node to solve. | ||
variables: | ||
|
||
- variable: A | ||
position: [1, 0] | ||
outcomes: [right, wrong] | ||
table: | ||
- [50, 50] | ||
|
||
- variable: B | ||
position: [33, 0] | ||
outcomes: [right, wrong] | ||
table: | ||
- [50, 50] | ||
|
||
- variable: C | ||
position: [65, 0] | ||
outcomes: [right, wrong] | ||
table: | ||
- [50, 50] | ||
|
||
- variable: D | ||
position: [97, 0] | ||
outcomes: [right, wrong] | ||
table: | ||
- [50, 50] | ||
|
||
- variable: Count correct | ||
position: [49, 8] | ||
outcomes: [0, 1, 2, 3, 4] | ||
given: [A, B, C, D] | ||
logic: count-true | ||
|
||
- variable: '"Two are right"' | ||
position: [1, 17] | ||
outcomes: [=>, " "] | ||
given: [A, Count == 2] | ||
logic: bicond | ||
|
||
- variable: '"Max. two are right"' | ||
position: [33, 17] | ||
outcomes: [=>, " "] | ||
given: [B, Count <= 3] | ||
logic: bicond | ||
|
||
- variable: '"B is wrong"' | ||
position: [65, 17] | ||
outcomes: [=>, " "] | ||
given: [C, B is wrong] | ||
logic: bicond | ||
|
||
- variable: '"Max. one is right"' | ||
position: [97, 17] | ||
outcomes: [=>, " "] | ||
given: [D, Count <= 1] | ||
logic: bicond | ||
|
||
- variable: Count == 2 | ||
position: [3, 24] | ||
outcomes: [right, wrong] | ||
given: [Count correct] | ||
logic: outcome-is 2 5 | ||
|
||
- variable: Count <= 3 | ||
position: [4, 29] | ||
outcomes: [right, wrong] | ||
given: [Count correct] | ||
logic: outcome-less 3 5 | ||
|
||
- variable: B is wrong | ||
position: [95, 24] | ||
outcomes: [right, wrong] | ||
given: ['"Max. two are right"'] | ||
logic: not | ||
|
||
- variable: Count <= 1 | ||
position: [94, 29] | ||
outcomes: [right, wrong] | ||
given: [Count correct] | ||
logic: outcome-less 2 5 | ||
|
||
- variable: Trigger | ||
position: [49, 24] | ||
color: blue | ||
outcomes: [==>, " "] | ||
given: | ||
- '"Two are right"' | ||
- '"Max. two are right"' | ||
- '"B is wrong"' | ||
- '"Max. one is right"' | ||
logic: count-is 4 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Weekday 7 friends puzzle | ||
info: >- | ||
Seven friends meet, and are not sure which day of the week it is. | ||
Each one has a guess, but only one is right. | ||
Which day of the week is it? | ||
Activate the ==> in the blue node to solve. | ||
variables: | ||
|
||
- variable: Day of week | ||
position: [41, 0] | ||
color: lime | ||
outcomes: [Mon, Tue, Wed, Thu, Fri, Sat, Sun] | ||
table: | ||
- [1, 1, 1, 1, 1, 1, 1] | ||
|
||
- variable: '"It is Monday"' | ||
position: [1, 13] | ||
given: [Day of week] | ||
outcomes: [yes, no] | ||
logic: outcome-is 0 7 | ||
|
||
- variable: '"It is Tuesday"' | ||
position: [28, 11] | ||
given: [Day of week] | ||
outcomes: [yes, no] | ||
logic: outcome-is 1 7 | ||
|
||
- variable: '"It is Wednesday"' | ||
position: [55, 11] | ||
given: [Day of week] | ||
outcomes: [yes, no] | ||
logic: outcome-is 2 7 | ||
|
||
- variable: '"It is Thursday or Friday"' | ||
position: [82, 13] | ||
given: [Day of week] | ||
outcomes: [yes, no] | ||
logic: outcome-either 3 4 7 | ||
|
||
- variable: '"It is Sunday"' | ||
position: [2, 19] | ||
given: [Day of week] | ||
outcomes: [yes, no] | ||
logic: outcome-is 6 7 | ||
|
||
- variable: '"Tomorrow is Monday"' | ||
position: [41, 18] | ||
given: [Day of week] | ||
outcomes: [yes, no] | ||
logic: outcome-is 6 7 | ||
|
||
- variable: '"It is not Sunday"' | ||
position: [81, 19] | ||
given: [Day of week] | ||
outcomes: [yes, no] | ||
logic: outcome-is-not 6 7 | ||
|
||
- variable: "Exactly one is correct " | ||
position: [39, 25] | ||
color: blue | ||
outcomes: [==>, " "] | ||
given: | ||
- '"It is Monday"' | ||
- '"It is Tuesday"' | ||
- '"It is Wednesday"' | ||
- '"It is Thursday or Friday"' | ||
- '"It is Sunday"' | ||
- '"Tomorrow is Monday"' | ||
- '"It is not Sunday"' | ||
logic: count-is 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.