about summary refs log tree commit diff stats
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-11-29 20:15:45 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2023-11-29 20:15:45 -0500
commit521a44eb720c0dbd8a30b38973fcd0352a22f825 (patch)
tree2b55ce48546e6fb41a2b9f37925a2f48f9c66cd8 /app/assets/javascripts
parent3eb639344c31ecc821c3d5c4151915c107f9bc38 (diff)
downloadwittle-521a44eb720c0dbd8a30b38973fcd0352a22f825.tar.gz
wittle-521a44eb720c0dbd8a30b38973fcd0352a22f825.tar.bz2
wittle-521a44eb720c0dbd8a30b38973fcd0352a22f825.zip
fix error-correction issues with overlapping lines
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/wittle/trace2.js12
-rw-r--r--app/assets/javascripts/wittle/utilities.js.erb1
2 files changed, 11 insertions, 2 deletions
diff --git a/app/assets/javascripts/wittle/trace2.js b/app/assets/javascripts/wittle/trace2.js index e36e4bd..81439e7 100644 --- a/app/assets/javascripts/wittle/trace2.js +++ b/app/assets/javascripts/wittle/trace2.js
@@ -696,7 +696,11 @@ window.onMove = function(dx, dy) {
696 data.path.pop().destroy() 696 data.path.pop().destroy()
697 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_NONE) 697 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_NONE)
698 if (data.puzzle.symType != SYM_TYPE_NONE) { 698 if (data.puzzle.symType != SYM_TYPE_NONE) {
699 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_NONE) 699 if (data.puzzle.getLine(data.sym.x, data.sym.y) == window.LINE_OVERLAP) {
700 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_BLUE)
701 } else {
702 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_NONE)
703 }
700 } 704 }
701 } 705 }
702 706
@@ -713,7 +717,11 @@ window.onMove = function(dx, dy) {
713 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_BLACK) 717 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_BLACK)
714 } else { 718 } else {
715 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_BLUE) 719 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_BLUE)
716 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_YELLOW) 720 if (data.puzzle.getLine(data.sym.x, data.sym.y) == window.LINE_BLUE) {
721 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_OVERLAP)
722 } else {
723 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_YELLOW)
724 }
717 } 725 }
718 } 726 }
719 } 727 }
diff --git a/app/assets/javascripts/wittle/utilities.js.erb b/app/assets/javascripts/wittle/utilities.js.erb index 6bf3a17..b621003 100644 --- a/app/assets/javascripts/wittle/utilities.js.erb +++ b/app/assets/javascripts/wittle/utilities.js.erb
@@ -129,6 +129,7 @@ window.LINE_NONE = 0
129window.LINE_BLACK = 1 129window.LINE_BLACK = 1
130window.LINE_BLUE = 2 130window.LINE_BLUE = 2
131window.LINE_YELLOW = 3 131window.LINE_YELLOW = 3
132window.LINE_OVERLAP = 4
132window.DOT_NONE = 0 133window.DOT_NONE = 0
133window.DOT_BLACK = 1 134window.DOT_BLACK = 1
134window.DOT_BLUE = 2 135window.DOT_BLUE = 2