From 91c78df78d7f2d2104dee10d429e316d4cde0a42 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Thu, 17 Jul 2025 20:55:40 +0200 Subject: [PATCH 01/10] WIP --- src-ui/list.html | 1 + src/pzpr/variety.js | 1 + src/res/failcode.en.json | 4 +- src/variety/blindrush.js | 355 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 359 insertions(+), 2 deletions(-) create mode 100644 src/variety/blindrush.js diff --git a/src-ui/list.html b/src-ui/list.html index 1b4dbf0b7..e999be264 100644 --- a/src-ui/list.html +++ b/src-ui/list.html @@ -252,6 +252,7 @@

パズルの種類のリスト
  • +
  • diff --git a/src/pzpr/variety.js b/src/pzpr/variety.js index ebb743517..2449ffdd2 100755 --- a/src/pzpr/variety.js +++ b/src/pzpr/variety.js @@ -106,6 +106,7 @@ battleship: [0, 0, "Battleship", "Battleship", "statuepark"], bdblock: [1, 0, "ボーダーブロック", "Border Block"], bdwalk: [0, 0, "ビルウォーク", "Building Walk", "haisu"], + blindrush: [0, 0, "猪突猛進", "Blind Rush"], bonsan: [1, 0, "ぼんさん", "Bonsan", "bonsan"], bosanowa: [1, 0, "ボサノワ", "Bosanowa", "", { alias: "bossanova" }], bosnianroad: [0, 0, "Bosnian Road", "Bosnian Road"], diff --git a/src/res/failcode.en.json b/src/res/failcode.en.json index 6126f3015..a0e7dd31f 100644 --- a/src/res/failcode.en.json +++ b/src/res/failcode.en.json @@ -768,8 +768,8 @@ "nmNoLine.kusabi": "A circle is not connected to another object.", "nmNoLine.wblink": "A circle doesn't start any line.", "nmNoLine": "A number is not connected to another number.", - "nmNoMove.bonsan": "A circle doesn't start any line.", - "nmNoMove.rectslider": "A shaded cell doesn't start any line.", + "nmNoMove.bonsan": "A circle doesn't move.", + "nmNoMove.rectslider": "A shaded cell doesn't move.", "nmNoOrbit.orbital": "A black circle is not inside a loop.", "nmNoSideShade.tasquare": "No shaded cells are adjacent to square marks.", "nmNotConsecNeighbors.ripple": "A number is not the neighbor of its consecutive numbers.", diff --git a/src/variety/blindrush.js b/src/variety/blindrush.js new file mode 100644 index 000000000..3f8917a78 --- /dev/null +++ b/src/variety/blindrush.js @@ -0,0 +1,355 @@ +// +// パズル固有スクリプト部 ぼんさん・へやぼん・四角スライダー版 bonsan.js +// +(function(pidlist, classbase) { + if (typeof module === "object" && module.exports) { + module.exports = [pidlist, classbase]; + } else { + pzpr.classmgr.makeCustom(pidlist, classbase); + } +})(["blindrush"], { + //--------------------------------------------------------- + MouseEvent: { + inputModes: { + edit: ["number", "clear"], + play: ["line", "bgcolor", "bgcolor1", "bgcolor2", "clear", "completion"] + }, + + // TODO clean up all these background colors + + mouseinput: function() { + switch (this.inputMode) { + case "completion": + if (this.mousestart) { + this.inputqcmp(1); + } + break; + default: + return this.common.mouseinput.call(this); + } + }, + mouseinput_auto: function() { + if (this.puzzle.playmode) { + if (this.mousestart || this.mousemove) { + this.inputLine(); + } else if (this.mouseend && this.notInputted()) { + this.inputlight(); + } + } else if (this.puzzle.editmode) { + if (this.mousestart || this.mousemove) { + this.inputborder(); + } else if (this.mouseend && this.notInputted()) { + this.inputqnum(); + } + } + }, + + inputLine: function() { + this.common.inputLine.call(this); + + /* "丸数字を移動表示しない"場合の背景色描画準備 */ + if ( + this.puzzle.execConfig("autocmp") && + !this.puzzle.execConfig("dispmove") && + !this.notInputted() + ) { + this.inputautodark(); + } + }, + inputautodark: function() { + /* 最後に入力した線を取得する */ + var opemgr = this.puzzle.opemgr, + lastope = opemgr.lastope; + if (lastope.group !== "border" || lastope.property !== "line") { + return; + } + var border = this.board.getb(lastope.bx, lastope.by); + + /* 線を引いた/消した箇所にある領域を取得 */ + var clist = new this.klass.CellList(); + Array.prototype.push.apply(clist, border.sideobj); + clist = clist.notnull().filter(function(cell) { + return cell.path !== null || cell.isNum(); + }); + + /* 改めて描画対象となるセルを取得して再描画 */ + clist.each(function(cell) { + if (cell.path === null) { + if (cell.isNum()) { + cell.draw(); + } + } else { + cell.path.clist.each(function(cell) { + if (cell.isNum()) { + cell.draw(); + } + }); + } + }); + }, + + inputlight: function() { + var cell = this.getcell(); + if (cell.isnull) { + return; + } + + if (this.inputdark(cell, 1)) { + return; + } + + if (this.mouseend && this.notInputted()) { + this.mouseCell = this.board.emptycell; + } + this.inputBGcolor(); + }, + inputqcmp: function(val) { + var cell = this.getcell(); + if (cell.isnull) { + return; + } + + this.inputdark(cell, val, true); + }, + inputdark: function(cell, val, multi) { + var cell = this.getcell(); + if (cell.isnull || (cell === this.mouseCell && multi)) { + return false; + } + + var targetcell = !this.puzzle.execConfig("dispmove") ? cell : cell.base, + distance = 0.6, + dx = this.inputPoint.bx - cell.bx /* ここはtargetcellではなくcell */, + dy = this.inputPoint.by - cell.by; + if ( + targetcell.isNum() && + (this.inputMode === "completion" || + (targetcell.qnum === -2 && dx * dx + dy * dy < distance * distance)) + ) { + if (this.inputData === null) { + this.inputData = targetcell.qcmp !== val ? 21 : 20; + } + + targetcell.setQcmp(this.inputData === 21 ? val : 0); + cell.draw(); + this.mouseCell = cell; + return true; + } + this.mouseCell = cell; + return false; + } + }, + //--------------------------------------------------------- + // キーボード入力系 + KeyEvent: { + enablemake: true + }, + + //--------------------------------------------------------- + // 盤面管理系 + Cell: { + isCmp: function() { + return this.isCmp_blindrush( + this.puzzle.execConfig("autocmp"), + this.puzzle.execConfig("dispmove"), + false + ); + }, + + getBurstCount: function() { + if (this.path === null) { + return 0; + } + var borders = this.path.getedgeobjs(); + var count = 0; + for (var i = 0; i < borders.length; i++) { + if (i > 0 && borders[i].isvert !== borders[i - 1].isvert) { + return -1; + } + if (borders[i].isBorder()) { + count++; + } + } + return count; + }, + + isStoppedAtWall: function() { + if (this.path === null || this.path.destination.isnull) { + return false; + } + var borders = this.path.destination.adjborder; + if (borders.left.isLine()) { + return borders.right.isnull || borders.right.isBorder(); + } else if (borders.right.isLine()) { + return borders.left.isnull || borders.left.isBorder(); + } else if (borders.top.isLine()) { + return borders.bottom.isnull || borders.bottom.isBorder(); + } else if (borders.bottom.isLine()) { + return borders.top.isnull || borders.top.isBorder(); + } + return false; + }, + + isCmp_blindrush: function(is_autocmp, is_dispmove) { + var targetcell = !is_dispmove ? this : this.base; + if (targetcell.qcmp === 1) { + return true; + } else if (!is_autocmp) { + return false; + } + + if (!this.isStoppedAtWall()) { + return false; + } + + var burst = this.getBurstCount(); + return burst >= 0 && targetcell.getNum() === burst; + }, + + maxnum: function() { + var bd = this.board, + bx = this.bx, + by = this.by; + var col = (bx < bd.maxbx >> 1 ? bd.maxbx - bx : bx) >> 1; + var row = (by < bd.maxby >> 1 ? bd.maxby - by : by) >> 1; + return Math.max(col, row); + }, + minnum: 0 + }, + Border: { + prehook: { + line: function(num) { + return this.puzzle.execConfig("dispmove") && this.checkFormCurve(num); + } + } + }, + + Board: { + cols: 8, + rows: 8, + + hasborder: 1 + }, + + LineGraph: { + enabled: true, + moveline: true + }, + //--------------------------------------------------------- + // 画像表示系 + Graphic: { + bgcellcolor_func: "qsub2", + autocmp: "number", + hideHatena: true, + + gridcolor_type: "LIGHT", + + numbercolor_func: "move", + qsubcolor1: "rgb(224, 224, 255)", + qsubcolor2: "rgb(255, 255, 144)", + + circlefillcolor_func: "qcmp", + + paint: function() { + this.drawBGCells(); + this.drawGrid(); + this.drawBorders(); + + this.drawTip(); + this.drawDepartures(); + this.drawLines(); + + this.drawCircledNumbers(); + + this.drawChassis(); + + this.drawTarget(); + } + }, + + //--------------------------------------------------------- + // URLエンコード/デコード処理 + Encode: { + decodePzpr: function(type) { + this.decodeBorder(); + this.decodeNumber16(); + }, + encodePzpr: function(type) { + this.encodeBorder(); + this.encodeNumber16(); + } + }, + //--------------------------------------------------------- + FileIO: { + decodeData: function() { + this.decodeCellQnum(); + this.decodeCellQsubQcmp(); + this.decodeBorderQues(); + this.decodeBorderLine(); + }, + encodeData: function() { + this.encodeCellQnum(); + this.encodeCellQsubQcmp(); + this.encodeBorderQues(); + this.encodeBorderLine(); + }, + + /* decode/encodeCellQsubの上位互換です */ + decodeCellQsubQcmp: function() { + this.decodeCell(function(cell, ca) { + if (ca !== "0") { + cell.qsub = +ca & 0x0f; + cell.qcmp = (+ca >> 4) & 1; // int + cell.anum = +ca >> 5 ? 0 : -1; + } + }); + }, + encodeCellQsubQcmp: function() { + this.encodeCell(function(cell) { + return ( + cell.qsub + (cell.qcmp << 4) + (cell.anum === 0 ? 1 << 5 : 0) + " " + ); + }); + } + }, + + //--------------------------------------------------------- + // 正解判定処理実行部 + AnsCheck: { + checklist: [ + "checkLineExist+", + "checkBranchLine", + "checkCrossLine", + + "checkConnectObject", + "checkLineOverLetter", + "checkCurveLine", + + // TODO check Burst count + // TODO check Wall network pierced more than once + // TODO check Wall network not pierced + // TODO check object not stopped in front of wall + + "checkNoMoveCircle", + "checkDisconnectLine" + ], + + checkCurveLine: function() { + this.checkAllArea( + this.board.linegraph, + function(w, h, a, n) { + return w === 1 || h === 1; + }, + "laCurve" + ); + }, + checkNoMoveCircle: function() { + this.checkAllCell(function(cell) { + return cell.isNum() && cell.lcnt === 0; + }, "nmNoMove"); + } + }, + FailCode: { + nmNoMove: "nmNoMove.bonsan" + } +}); From 7bb14d7aab112184edbe1d65e9b839e71e431da4 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 19 Jul 2025 11:48:59 +0200 Subject: [PATCH 02/10] Add more failchecks --- src/res/failcode.en.json | 2 ++ src/variety/blindrush.js | 37 ++++++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/res/failcode.en.json b/src/res/failcode.en.json index a0e7dd31f..842643c15 100644 --- a/src/res/failcode.en.json +++ b/src/res/failcode.en.json @@ -515,6 +515,7 @@ "laIsolate.rectslider": "A line doesn't connect any shaded cell.", "laIsolate.yosenabe": "A line doesn't connect any filling.", "laIsolate": "A line doesn't connect to any letter.", + "laLenNe.blindrush": "A number doesn't go through the correct amount of walls.", "laLenNe.herugolf": "A ball stops halfway.", "laLenNe": "The length of a line is wrong.", "laLoop": "A line forms a loop.", @@ -532,6 +533,7 @@ "laOnNum": "A line goes through a letter.", "laShadeOnBorder.oyakodori": "A black bird goes over a border.", "laUnshadeNoBorder.oyakodori": "A white bird does not go over a border.", + "laWallStop.blindrush": "A circle does not stop at a wall.", "laWaterHazard.herugolf": "A ball lands into the water.", "lbDivide.amibo": "The bars are not connected.", "lbIsolate.walllogic": "A line doesn't connect to any number.", diff --git a/src/variety/blindrush.js b/src/variety/blindrush.js index 3f8917a78..c90679e74 100644 --- a/src/variety/blindrush.js +++ b/src/variety/blindrush.js @@ -174,7 +174,7 @@ }, isStoppedAtWall: function() { - if (this.path === null || this.path.destination.isnull) { + if (!this.path || !this.path.destination) { return false; } var borders = this.path.destination.adjborder; @@ -325,15 +325,46 @@ "checkLineOverLetter", "checkCurveLine", - // TODO check Burst count + "checkBurstCount", + "checkRestingPosition", + // TODO check Wall network pierced more than once // TODO check Wall network not pierced - // TODO check object not stopped in front of wall "checkNoMoveCircle", "checkDisconnectLine" ], + movementCheck: function(func, code) { + for (var c = 0; c < this.board.cell.length; c++) { + var cell = this.board.cell[c]; + if (!cell.isNum() || !cell.path || cell.path.destination === cell) { + continue; + } + if (!func(cell)) { + continue; + } + + this.failcode.add(code); + if (this.checkOnly) { + break; + } + cell.path.clist.seterr(1); + } + }, + + checkBurstCount: function() { + this.movementCheck(function(cell) { + return cell.isValidNum() && cell.getBurstCount() !== cell.getNum(); + }, "laLenNe"); + }, + + checkRestingPosition: function() { + this.movementCheck(function(cell) { + return !cell.isStoppedAtWall(); + }, "laWallStop"); + }, + checkCurveLine: function() { this.checkAllArea( this.board.linegraph, From 362b6b1cdccfccc326da43dbd3ce32147712090c Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 19 Jul 2025 13:34:52 +0200 Subject: [PATCH 03/10] Add rest of AnsCheck --- src/res/failcode.en.json | 2 ++ src/variety/blindrush.js | 78 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/src/res/failcode.en.json b/src/res/failcode.en.json index 842643c15..bdcdc0906 100644 --- a/src/res/failcode.en.json +++ b/src/res/failcode.en.json @@ -69,6 +69,8 @@ "bdNotChassis.shwolf": "A line doesn't connect to the chassis.", "bdPassStar.nuriuzu": "A star overlaps a shaded cell.", "bdPassStar.tentaisho": "A line goes over a star.", + "bdPierceGt1.blindrush": "A network of walls is pierced more than once.", + "bdPierceLt1.blindrush": "A network of walls is not pierced by a line.", "bdUnequal.antmill": "A cross clue does not overlap exactly 1 shaded cell.", "bdUnused.fillomino": "A given border does not divide two regions.", "bdUnused.kissing": "A bar is not adjacent to two different blocks.", diff --git a/src/variety/blindrush.js b/src/variety/blindrush.js index c90679e74..ae9f000fd 100644 --- a/src/variety/blindrush.js +++ b/src/variety/blindrush.js @@ -223,12 +223,55 @@ } } }, + "BorderGraph:AreaGraphBase": { + enabled: true, + pointgroup: "border", + relation: { "border.ques": "node" }, + + setComponentRefs: function(obj, component) { + obj.bdarea = component; + }, + getObjNodeList: function(nodeobj) { + return nodeobj.bdareanodes; + }, + resetObjNodeList: function(nodeobj) { + nodeobj.bdareanodes = []; + }, + + isnodevalid: function(nodeobj) { + return nodeobj.isBorder(); + }, + + getSideObjByNodeObj: function(border) { + var borders = [ + border.relbd(-1, -1), + border.relbd(-1, 1), + border.relbd(1, -1), + border.relbd(1, 1) + ]; + if (border.isvert) { + borders.push(border.relbd(0, -2)); + borders.push(border.relbd(0, 2)); + } else { + borders.push(border.relbd(-2, 0)); + borders.push(border.relbd(2, 0)); + } + + return borders.filter(function(b) { + return !b.isnull; + }); + } + }, Board: { cols: 8, rows: 8, - hasborder: 1 + hasborder: 1, + + addExtraInfo: function() { + this.bordergraph = this.addInfoList(this.klass.BorderGraph); + } }, LineGraph: { @@ -328,8 +371,8 @@ "checkBurstCount", "checkRestingPosition", - // TODO check Wall network pierced more than once - // TODO check Wall network not pierced + "checkPierceMultiple", + "checkPierceNone", "checkNoMoveCircle", "checkDisconnectLine" @@ -365,6 +408,35 @@ }, "laWallStop"); }, + pierceCheck: function(flag, code) { + var walls = this.board.bordergraph.components; + for (var id = 0; id < walls.length; id++) { + var wall = walls[id]; + var count = wall.clist.filter(function(border) { + return border.isLine(); + }).length; + + if ((count > 0 && flag === 0) || (count <= 1 && flag > 0)) { + continue; + } + + this.failcode.add(code); + if (this.checkOnly) { + break; + } + this.board.border.setnoerr(); + wall.clist.seterr(1); + } + }, + + checkPierceNone: function() { + this.pierceCheck(0, "bdPierceLt1"); + }, + + checkPierceMultiple: function() { + this.pierceCheck(1, "bdPierceGt1"); + }, + checkCurveLine: function() { this.checkAllArea( this.board.linegraph, From 924c02d75795970ae51719839f8ed3d9b0f76d68 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 19 Jul 2025 16:28:47 +0200 Subject: [PATCH 04/10] Graphics --- src/variety/blindrush.js | 69 +++++++++------------------------------- 1 file changed, 15 insertions(+), 54 deletions(-) diff --git a/src/variety/blindrush.js b/src/variety/blindrush.js index ae9f000fd..74f7dbdb2 100644 --- a/src/variety/blindrush.js +++ b/src/variety/blindrush.js @@ -12,28 +12,15 @@ MouseEvent: { inputModes: { edit: ["number", "clear"], - play: ["line", "bgcolor", "bgcolor1", "bgcolor2", "clear", "completion"] + play: ["line", "peke", "clear", "completion"] }, - // TODO clean up all these background colors - - mouseinput: function() { - switch (this.inputMode) { - case "completion": - if (this.mousestart) { - this.inputqcmp(1); - } - break; - default: - return this.common.mouseinput.call(this); - } - }, mouseinput_auto: function() { if (this.puzzle.playmode) { if (this.mousestart || this.mousemove) { this.inputLine(); } else if (this.mouseend && this.notInputted()) { - this.inputlight(); + this.inputqcmp(); } } else if (this.puzzle.editmode) { if (this.mousestart || this.mousemove) { @@ -88,49 +75,19 @@ }); }, - inputlight: function() { + inputqcmp: function() { var cell = this.getcell(); if (cell.isnull) { - return; - } - - if (this.inputdark(cell, 1)) { - return; - } - - if (this.mouseend && this.notInputted()) { - this.mouseCell = this.board.emptycell; - } - this.inputBGcolor(); - }, - inputqcmp: function(val) { - var cell = this.getcell(); - if (cell.isnull) { - return; - } - - this.inputdark(cell, val, true); - }, - inputdark: function(cell, val, multi) { - var cell = this.getcell(); - if (cell.isnull || (cell === this.mouseCell && multi)) { return false; } - var targetcell = !this.puzzle.execConfig("dispmove") ? cell : cell.base, - distance = 0.6, - dx = this.inputPoint.bx - cell.bx /* ここはtargetcellではなくcell */, - dy = this.inputPoint.by - cell.by; - if ( - targetcell.isNum() && - (this.inputMode === "completion" || - (targetcell.qnum === -2 && dx * dx + dy * dy < distance * distance)) - ) { + var targetcell = !this.puzzle.execConfig("dispmove") ? cell : cell.base; + if (targetcell.isNum()) { if (this.inputData === null) { - this.inputData = targetcell.qcmp !== val ? 21 : 20; + this.inputData = targetcell.qcmp !== 1 ? 21 : 20; } - targetcell.setQcmp(this.inputData === 21 ? val : 0); + targetcell.setQcmp(this.inputData === 21 ? 1 : 0); cell.draw(); this.mouseCell = cell; return true; @@ -281,15 +238,12 @@ //--------------------------------------------------------- // 画像表示系 Graphic: { - bgcellcolor_func: "qsub2", autocmp: "number", hideHatena: true, gridcolor_type: "LIGHT", numbercolor_func: "move", - qsubcolor1: "rgb(224, 224, 255)", - qsubcolor2: "rgb(255, 255, 144)", circlefillcolor_func: "qcmp", @@ -307,6 +261,13 @@ this.drawChassis(); this.drawTarget(); + }, + + getBorderColor: function(border) { + if (border.ques) { + return border.error === 2 ? this.errcolor1 : this.quescolor; + } + return null; } }, @@ -425,7 +386,7 @@ break; } this.board.border.setnoerr(); - wall.clist.seterr(1); + wall.clist.seterr(2); } }, From 342218c6fb6070d5d225f1e442c98553d13737c2 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 19 Jul 2025 17:18:24 +0200 Subject: [PATCH 05/10] Add pekes --- src/variety/blindrush.js | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/variety/blindrush.js b/src/variety/blindrush.js index 74f7dbdb2..724ea0c07 100644 --- a/src/variety/blindrush.js +++ b/src/variety/blindrush.js @@ -17,9 +17,8 @@ mouseinput_auto: function() { if (this.puzzle.playmode) { - if (this.mousestart || this.mousemove) { - this.inputLine(); - } else if (this.mouseend && this.notInputted()) { + this.mouseinputAutoPlay_line(); + if (this.mouseend && this.notInputted()) { this.inputqcmp(); } } else if (this.puzzle.editmode) { @@ -114,7 +113,7 @@ }, getBurstCount: function() { - if (this.path === null) { + if (!this.path) { return 0; } var borders = this.path.getedgeobjs(); @@ -131,7 +130,11 @@ }, isStoppedAtWall: function() { - if (!this.path || !this.path.destination) { + if ( + !this.path || + !this.path.destination || + this.path.destination.isnull + ) { return false; } var borders = this.path.destination.adjborder; @@ -259,6 +262,7 @@ this.drawCircledNumbers(); this.drawChassis(); + this.drawPekes(); this.drawTarget(); }, @@ -287,33 +291,15 @@ FileIO: { decodeData: function() { this.decodeCellQnum(); - this.decodeCellQsubQcmp(); this.decodeBorderQues(); + this.decodeCellAnumsub(); this.decodeBorderLine(); }, encodeData: function() { this.encodeCellQnum(); - this.encodeCellQsubQcmp(); this.encodeBorderQues(); + this.encodeCellAnumsub(); this.encodeBorderLine(); - }, - - /* decode/encodeCellQsubの上位互換です */ - decodeCellQsubQcmp: function() { - this.decodeCell(function(cell, ca) { - if (ca !== "0") { - cell.qsub = +ca & 0x0f; - cell.qcmp = (+ca >> 4) & 1; // int - cell.anum = +ca >> 5 ? 0 : -1; - } - }); - }, - encodeCellQsubQcmp: function() { - this.encodeCell(function(cell) { - return ( - cell.qsub + (cell.qcmp << 4) + (cell.anum === 0 ? 1 << 5 : 0) + " " - ); - }); } }, From 5548d7e20bc8f426b05feefe13f60185c858271f Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 2 Aug 2025 19:48:03 +0200 Subject: [PATCH 06/10] Examples and failchecks --- test/script/blindrush.js | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 test/script/blindrush.js diff --git a/test/script/blindrush.js b/test/script/blindrush.js new file mode 100644 index 000000000..77a751f66 --- /dev/null +++ b/test/script/blindrush.js @@ -0,0 +1,60 @@ +/* blindrush.js */ + +ui.debug.addDebugData("blindrush", { + url: "5/5/0h0lo028.r1m2i", + failcheck: [ + [ + "brNoLine", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "lnBranch", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /0 0 0 0 /0 0 0 0 /1 1 1 0 /0 0 0 0 /0 0 0 0 /1 0 0 0 0 /1 0 0 0 0 /1 0 0 0 0 /1 0 0 0 0 /" + ], + [ + "lnCross", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /0 0 0 0 /0 0 0 0 /1 1 1 0 /0 0 0 0 /0 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /" + ], + [ + "nmConnected", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /1 1 1 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 1 0 /0 0 0 1 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "laOnNum", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /0 0 0 0 /0 0 0 0 /1 1 1 1 /0 0 0 0 /0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "laCurve", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /0 0 0 0 /0 0 0 0 /0 0 1 0 /0 0 0 0 /0 1 1 1 /1 0 1 0 0 /1 0 1 0 0 /1 0 0 0 0 /1 0 0 0 0 /" + ], + [ + "laIsolate", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /1 1 1 1 /0 0 1 1 /1 1 1 0 /0 0 0 0 /0 1 1 1 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "laLenNe", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 0 0 0 0 /1 1 0 0 0 /1 1 0 1 0 /1 1 0 1 0 /" + ], + [ + "laWallStop", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /0 0 0 0 /0 0 0 0 /0 1 1 0 /0 0 0 0 /0 1 1 1 /1 0 0 0 0 /1 0 0 0 0 /1 0 0 0 0 /1 0 0 0 0 /" + ], + [ + "nmNoMove", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 1 0 0 0 /0 1 0 0 0 /0 1 0 1 0 /0 1 0 1 0 /" + ], + [ + "bdPierceLt1", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . - . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /1 1 1 1 /0 0 0 0 /0 0 0 1 /0 0 0 0 /0 1 1 1 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ], + [ + "bdPierceGt1", + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /. . . . . /. . . . . /. . . . . /. . . . . /. . . . . /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /0 0 0 0 /1 1 0 0 0 /1 1 0 0 0 /1 1 0 1 0 /1 1 0 1 0 /" + ], + [ + null, + "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /c . . . . /. . . . . /. . . . . /. . . . . /. . . . . /1 1 1 1 /0 0 0 0 /1 1 1 0 /0 0 0 0 /0 1 1 1 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" + ] + ], + inputs: [] +}); From 1fc42e3b8c97c6994de6d11642456196ae5529d8 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Sat, 2 Aug 2025 20:45:08 +0200 Subject: [PATCH 07/10] Add keypopup --- src-ui/js/ui/KeyPopup.js | 26 +++----------------------- src/variety/blindrush.js | 7 +++++++ 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src-ui/js/ui/KeyPopup.js b/src-ui/js/ui/KeyPopup.js index 56b1e5a06..ebaddb5f9 100644 --- a/src-ui/js/ui/KeyPopup.js +++ b/src-ui/js/ui/KeyPopup.js @@ -231,6 +231,7 @@ ui.keypopup = { wataridori: [10, 0], kurarin: [133, 0], narrow: [134, 0], + blindrush: [10, 0], isowatari: [10, 0], uturns: [133, 0] }, @@ -482,29 +483,8 @@ ui.keypopup = { text: "■", color: "rgb(204,204,204)" }; - } else if ( - pid === "kurotto" || - pid === "bonsan" || - pid === "satogaeri" || - pid === "heyabon" || - pid === "yosenabe" || - pid === "herugolf" || - pid === "kazunori" || - pid === "nurimisaki" || - pid === "amibo" || - pid === "firefly" || - pid === "shikaku" || - pid === "aho" || - pid === "bosanowa" || - pid === "portal" || - pid === "minarism" || - pid === "mintonette" || - pid === "onsen" || - pid === "wataridori" - ) { - cap = "○"; - } else if (!ui.puzzle.painter.hideHatena) { - cap = "?"; + } else { + cap = ui.puzzle.painter.hideHatena ? "○" : "?"; } if (cap !== null) { itemlist.push(["-", cap]); diff --git a/src/variety/blindrush.js b/src/variety/blindrush.js index 724ea0c07..313bd357f 100644 --- a/src/variety/blindrush.js +++ b/src/variety/blindrush.js @@ -267,6 +267,13 @@ this.drawTarget(); }, + getLineColor: function(border) { + if (border.isLine() && border.error === 2) { + return this.noerrcolor; + } + return this.common.getLineColor.call(this, border); + }, + getBorderColor: function(border) { if (border.ques) { return border.error === 2 ? this.errcolor1 : this.quescolor; From e6a96b7f520404b219e3cea9486a021137b74a61 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 26 Aug 2025 18:42:11 +0200 Subject: [PATCH 08/10] Add to changelog --- src-ui/changes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/changes.html b/src-ui/changes.html index 1c2836c86..9a1b311d0 100644 --- a/src-ui/changes.html +++ b/src-ui/changes.html @@ -33,13 +33,13 @@
    Latest types (all types)
    From a1aceb581be86ae5008dea4fa64468bc83f3f1a4 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 26 Aug 2025 18:51:36 +0200 Subject: [PATCH 09/10] Fix FailCode messages --- src/variety/blindrush.js | 5 ++++- src/variety/yosenabe.js | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/variety/blindrush.js b/src/variety/blindrush.js index 313bd357f..c84076d4a 100644 --- a/src/variety/blindrush.js +++ b/src/variety/blindrush.js @@ -407,6 +407,9 @@ } }, FailCode: { - nmNoMove: "nmNoMove.bonsan" + nmNoMove: "nmNoMove.bonsan", + laIsolate: "laIsolate.bonsan", + nmConnected: "nmConnected.bonsan", + laOnNum: "laOnNum.bonsan" } }); diff --git a/src/variety/yosenabe.js b/src/variety/yosenabe.js index 80aa56cea..564bc6708 100644 --- a/src/variety/yosenabe.js +++ b/src/variety/yosenabe.js @@ -1211,6 +1211,8 @@ } }, "FailCode@brownies": { + nmNoMove: "nmNoMove.bonsan", + laIsolate: "laIsolate.bonsan", nmConnected: "nmConnected.bonsan", laOnNum: "laOnNum.bonsan" } From a962ef730a48e9d52e5137e7d7392cec7f8270b5 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Tue, 26 Aug 2025 19:13:00 +0200 Subject: [PATCH 10/10] Cleanup --- src/variety/blindrush.js | 44 ---------------------------------------- test/script/blindrush.js | 22 +++++++++++++++++++- 2 files changed, 21 insertions(+), 45 deletions(-) diff --git a/src/variety/blindrush.js b/src/variety/blindrush.js index c84076d4a..d05db91d0 100644 --- a/src/variety/blindrush.js +++ b/src/variety/blindrush.js @@ -30,50 +30,6 @@ } }, - inputLine: function() { - this.common.inputLine.call(this); - - /* "丸数字を移動表示しない"場合の背景色描画準備 */ - if ( - this.puzzle.execConfig("autocmp") && - !this.puzzle.execConfig("dispmove") && - !this.notInputted() - ) { - this.inputautodark(); - } - }, - inputautodark: function() { - /* 最後に入力した線を取得する */ - var opemgr = this.puzzle.opemgr, - lastope = opemgr.lastope; - if (lastope.group !== "border" || lastope.property !== "line") { - return; - } - var border = this.board.getb(lastope.bx, lastope.by); - - /* 線を引いた/消した箇所にある領域を取得 */ - var clist = new this.klass.CellList(); - Array.prototype.push.apply(clist, border.sideobj); - clist = clist.notnull().filter(function(cell) { - return cell.path !== null || cell.isNum(); - }); - - /* 改めて描画対象となるセルを取得して再描画 */ - clist.each(function(cell) { - if (cell.path === null) { - if (cell.isNum()) { - cell.draw(); - } - } else { - cell.path.clist.each(function(cell) { - if (cell.isNum()) { - cell.draw(); - } - }); - } - }); - }, - inputqcmp: function() { var cell = this.getcell(); if (cell.isnull) { diff --git a/test/script/blindrush.js b/test/script/blindrush.js index 77a751f66..bf45c1ef3 100644 --- a/test/script/blindrush.js +++ b/test/script/blindrush.js @@ -56,5 +56,25 @@ ui.debug.addDebugData("blindrush", { "pzprv3/blindrush/5/5/- . . . . /. . . . . /. . . 1 . /. . . . . /. 2 . . . /0 0 0 0 /0 1 0 0 /0 1 0 0 /0 0 0 1 /0 1 0 1 /1 1 0 0 0 /0 0 0 0 0 /0 0 0 1 0 /0 1 0 0 0 /c . . . . /. . . . . /. . . . . /. . . . . /. . . . . /1 1 1 1 /0 0 0 0 /1 1 1 0 /0 0 0 0 /0 1 1 1 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /0 0 0 0 0 /" ] ], - inputs: [] + inputs: [ + { + input: [ + "newboard,5,1", + "editmode", + "cursor,1,1", + "mouse,left,1,1", + "mouse,left,2,0,2,2" + ], + result: "pzprv3/blindrush/1/5/- . . . . /1 0 0 0 /. . . . . /0 0 0 0 /" + }, + { + input: [ + "playmode", + "mouse,left,1,1,5,1", + "mouse,left,5,1", + "mouse,left,6,1" + ], + result: "pzprv3/blindrush/1/5/- . . . . /1 0 0 0 /c . . . . /1 1 -1 0 /" + } + ] });