Skip to content

Commit

Permalink
GeM: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DrDr3ck committed Jan 13, 2024
1 parent 1196133 commit b61a6e4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions GuildeMarchande/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ function getBorderRuins() {
});
}

function getTypedRuins() {
function hasAllTypedRuins() {
const typedRuins = [false, false, false];
ruins.forEach((ruin) => {
const ring = getRing(ruin.x, ruin.y);
Expand Down Expand Up @@ -1372,7 +1372,7 @@ function checkGoals() {
}
});
// explorer des cases ruines adjacentes à prairie, desert et montagne
if (getTypedRuins()) {
if (hasAllTypedRuins()) {
reachGoal(1);
}
// etablir une route commerciale >= 12
Expand Down Expand Up @@ -2804,6 +2804,13 @@ function test() {
]),
"error in checkCenteredCubes 2"
);

expect(hasAllTypedRuins(), "error in hasAllTypedRuins");
ruins = [
{ x: 18, y: 5 },
{ x: 8, y: 2 },
];
expect(!hasAllTypedRuins(), "error in hasAllTypedRuins");
}

test();

0 comments on commit b61a6e4

Please sign in to comment.