diff --git a/cypress/integration/spec.js b/cypress/integration/spec.js index cd502a4..ed39e13 100644 --- a/cypress/integration/spec.js +++ b/cypress/integration/spec.js @@ -17,7 +17,7 @@ describe("game should", () => { it("display game over", () => { cy.visit("/") - cy.get("[data-cy=game-over]").as("game-over").should("not.be.visible") + cy.get("[data-cy=gameover]").as("gameover").should("not.be.visible") cy.get(".div2.pole").click() cy.get(".div0.dest").click() @@ -43,13 +43,14 @@ describe("game should", () => { cy.get(".div14.pole").click() cy.get(".div11.dest").click() - cy.get("@game-over").should("be.be.visible") + cy.get("@gameover").should("be.be.visible") }) it("display victory", () => { cy.visit("/") cy.get("[data-cy=victory]").as("victory").should("not.be.visible") + // 2>0 11>2 3>1 9>2 0>9 13>8 14>11 1>3 5>12 12>7 4>2 2>9 8>13 cy.get(".div2.pole").click() cy.get(".div0.dest").click() cy.get(".div11.pole").click() @@ -79,6 +80,4 @@ describe("game should", () => { cy.get("@victory").should("be.visible") }) - - // 2>0 11>2 3>1 9>2 0>9 13>8 14>11 1>3 5>12 12>7 4>2 2>9 8>13 }) diff --git a/src/App.svelte b/src/App.svelte index 3b64192..75e9c03 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,393 +1,7 @@ - -
-
- RESTART GAME - | GAME OVER - | VICTORY -
-
- {#each circles as _, i} - {#if circles[i] == hole} -
change(i)}> - {i} -
- {/if} - {#if circles[i] == pole} -
change(i)}> - {i} -
- {/if} - {#if circles[i] == pick} -
change(i)}> - {i} -
- {/if} - {#if circles[i] == dest} -
change(i)}> - {i} -
- {/if} - {/each} -
+
diff --git a/src/Triangle.svelte b/src/Triangle.svelte new file mode 100644 index 0000000..4500511 --- /dev/null +++ b/src/Triangle.svelte @@ -0,0 +1,379 @@ + + + + +RESTART GAME + | GAME OVER + | VICTORY + +
+ {#each circles as _, i} + {#if circles[i] == C_HOLE} +
change(i)}> + {i} +
+ {/if} + {#if circles[i] == C_POLE} +
change(i)}> + {i} +
+ {/if} + {#if circles[i] == C_PICK} +
change(i)}> + {i} +
+ {/if} + {#if circles[i] == C_DEST} +
change(i)}> + {i} +
+ {/if} + {/each} +