Skip to content

Commit

Permalink
yajilin: Repair hook when adding clue
Browse files Browse the repository at this point in the history
  • Loading branch information
x-sheep committed Aug 7, 2023
1 parent 59051b4 commit 5823c51
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/variety/yajilin.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,6 @@
}
}
this.board.redrawAffected(cells);
},
qnum: function() {
this.setQsub(0);
this.setQans(0);
var adb = this.adjborder;
var bs = [adb.top, adb.bottom, adb.left, adb.right];
for (var i = 0; i < bs.length; i++) {
bs[i].line = 0;
}
}
}
},
Expand Down Expand Up @@ -231,6 +222,19 @@
clist.add(cell);
}
return clist;
},

prehook: {
qnum: function() {
this.setQsub(0);
this.setQans(0);
var adb = this.adjborder;
var bs = [adb.top, adb.bottom, adb.left, adb.right];
for (var i = 0; i < bs.length; i++) {
bs[i].removeLine();
bs[i].draw();
}
}
}
},
"Cell@koburin#2": {
Expand Down
9 changes: 9 additions & 0 deletions test/script/yajilin.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ ui.debug.addDebugData("yajilin", {
{
input: ["editmode", "cursor,5,1", "mouse,left, 5,1"],
result: "pzprv3/yajilin/1/4/0,- . 0,- . /. . . . /0 0 0 /"
},
/* test prehook */
{
input: ["newboard,2,2", "playmode", "mouse,left,1,1,3,1,3,3,1,3"],
result: "pzprv3/yajilin/2/2/. . /. . /. . /. . /1 /1 /0 1 /"
},
{
input: ["editmode", "cursor,1,3", "key,1"],
result: "pzprv3/yajilin/2/2/. . /0,1 . /. . /. . /1 /0 /0 1 /"
}
]
});

1 comment on commit 5823c51

@vercel
Copy link

@vercel vercel bot commented on 5823c51 Aug 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pzprjs – ./

pzprjs.vercel.app
pzprjs-git-main-robx.vercel.app
pzprjs-robx.vercel.app

Please sign in to comment.