summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorJulien Dessaux2022-10-26 23:16:20 +0200
committerJulien Dessaux2022-10-26 23:16:20 +0200
commitd551b4579d224bd3b123fc1e16e30f4731728090 (patch)
treef40d4c762646724e966c8e17e4a7b8cbdf1ee443 /static
parentFixed makefile (diff)
downloadjeux-de-mots-d551b4579d224bd3b123fc1e16e30f4731728090.tar.gz
jeux-de-mots-d551b4579d224bd3b123fc1e16e30f4731728090.tar.bz2
jeux-de-mots-d551b4579d224bd3b123fc1e16e30f4731728090.zip
Allow for placing the first word
Diffstat (limited to 'static')
-rw-r--r--static/index.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/static/index.js b/static/index.js
index 0d10935..4b80ab5 100644
--- a/static/index.js
+++ b/static/index.js
@@ -179,6 +179,7 @@ let CW = function(){
if (x>0) { // we check if we are connected on the left of the first letter
connected ||= CWDATA.board[y][x-1] != "";
}
+ if (x === 7 && y === 7) connected = true; // starting tile
// check if the placed letters are aligned and complete connection checks on the first and last letters
let direction = undefined;
if (x === lastx) {
@@ -207,6 +208,7 @@ let CW = function(){
} else {
x++;
}
+ if (x === 7 && y === 7) connected = true; // starting tile
if (placed[i].x === x && placed[i].y === y) {
// check around this letter
if (direction === "down") {