Skip to content

Commit

Permalink
Refactor predicates test
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMagzuz authored and Bliztle committed May 15, 2024
1 parent 7bf9469 commit 31472b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
}
},
{
"Species": "Counter",
"Species": "stdCounter",
"State": "Counting",
"Fields": {
"generation": 0
"x": 2
}
}
][
Expand All @@ -45,10 +45,10 @@
}
},
{
"Species": "Counter",
"Species": "stdCounter",
"State": "Counting",
"Fields": {
"generation": 1
"x": 1
}
}
][
Expand Down Expand Up @@ -82,10 +82,10 @@
}
},
{
"Species": "Counter",
"Species": "stdCounter",
"State": "Counting",
"Fields": {
"generation": 2
"x": 0
}
}
][
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
species Citizen(int townId) {

state Alive {
enter Alive;
}
}

species Town(int id, int citizenCount) {

decorator updateCitizenCount {
citizenCount = count(Citizen::?(townId: id));
}
Expand All @@ -18,22 +16,8 @@ species Town(int id, int citizenCount) {
}
}

species Counter(int generation) {
state Counting {
generation = generation + 1;
if (generation > 2) {
exit;
}
enter Counting;
}
}

function setup() -> void {
create Town::Stable(id: 1, citizenCount: 0);
create Citizen::Alive(townId: 1);
create Counter::Counting(generation: 0);
ExitAfterTicks(2);
}




0 comments on commit 31472b1

Please sign in to comment.