home
puzzles
genres
studio
help
about
links
forum


Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
Messages posted by: JHe
Profile for JHe -> Messages posted by JHe [109] Go to Page: 1, 2, 3, 4, 5, 6, 7, 8 Next 
Author Message
Congrats for reaching 5000 puzzles! At least the search page says so.

(I'm a little late, hence the title)
Number: Puzzle #6332
Genre: Heterocut
Author: anurag.sahay
Appeared at: August 24, 2020

The 1x2 box allows numbers. So I assumed it belongs to the puzzle, but that led to an impossibility. Now I restart with it outside, but is that numbering a glitch?

EDIT: Actually I found a way out of that impasse. Sorry for taking your time, this can be removed..
It was apparently with the same number, because my solution worked right away. (I had saved it)
4 isn't needed if I checked it correctly - all squares are used for these numbers. So I guess that it was around at a time but was obsolete in the final version.
I'm using Firefox and the puzzle worked for me.
The patch was JavaScript and some minor addition to the HTML. Here they are pasted, since attachment seems to be a problem.

HTML:

<!DOCTYPE html>
<html>
<head>
<title>Puzzlepicnic Interactive Puzzle</title>
<link rel="stylesheet" href="./puzzle.css">


</head>
<body>
<script src='downloaded/kinetic-v5.0.1.js'></script>
<script src='downloaded/jquery-2.1.0.js'></script>
<script src='fake-puzzle-backend.js'></script>
<script src="src/impl/bounding-box.js"></script>
<script src="src/impl/puzzle-model-helper.js"></script>
<script src="src/impl/kinetic/shape-painter.js"></script>
<script src="src/impl/kinetic/puzzle-view-part.js"></script>
<script src="src/impl/kinetic/puzcode-element-painter.js"></script>
<script src="src/impl/puzzle-state.js"></script>
<script src="src/impl/reporter.js"></script>
<script src="src/impl/storage.js"></script>
<script src='src/impl/model/shape-modifiers.js'></script>
<script src='src/impl/model/shape-factory.js'></script>
<script src='src/impl/puzzle-model-search.js'></script>
<script src='src/impl/puzzle-model.js'></script>
<script src='src/impl/puzzle-presenter.js'></script>
<script src='src/impl/puzzle-action-listener.js'></script>
<script src='src/impl/puzzle-action-engine.js'></script>
<script src='src/impl/user-activity-view-event-handler.js'></script>
<script src='src/impl/user-activity-listener.js'></script>
<script src='src/impl/kinetic/stage-factory.js'></script>
<script src='src/impl/kinetic/interactive-puzzle-view.js'></script>
<script src='src/impl/pencil-colors.js'></script>
<script src='src/impl/kinetic/shapes-view.js'></script>
<script src='src/api/interactive-puzzle.js'></script>
<script src='src/impl/interactive-puzzle-controls.js'></script>
<h2>Interactive Puzzle</h2>
<div id="pp-canvas-container"></div>
<div id="pp-reveal" class="hide"></div>
<div id="pp-clear" class="hide">
<big>Erase which colours?</big>
<button type="button" class="imgbutton" onclick="puzzle.clearPencilColor(0)"><img src="public/images/pp-canvas/blue.png" alt="Blue"></button>
<button type="button" class="imgbutton" onclick="puzzle.clearPencilColor(1)"><img src="public/images/pp-canvas/red.png" alt="Red"></button>
<button type="button" class="imgbutton" onclick="puzzle.clearPencilColor(2)"><img src="public/images/pp-canvas/green.png" alt="Green"></button>
<button type="button" class="imgbutton" onclick="puzzle.clearPencilColor(3)"><img src="public/images/pp-canvas/orange.png" alt="Orange"></button>
<button type="button" class="imgbutton" onclick="puzzle.clearPencilColor(4)"><img src="public/images/pp-canvas/purple.png" alt="Purple"></button>
<button type="button" class="imgbutton" onclick="puzzle.clearPencilColor(5)"><img src="public/images/pp-canvas/grey.png" alt="Grey"></button>
<button type="button" onclick="presenter.clearAll()">Clear all</button>
<button type="button" onclick="$('#pp-clear').addClass('hide'); $('#pp-canvas-controls').removeClass('hide');">Exit/Stop/Ready/Done</button>

</div>
<button id="puzzleCorrectAlert" onclick="controls.hideCorrect()" class="hide puzzlealert">Congratulations! You have correctly solved the puzzle.</button>
<button id="puzzleIncorrectAlert" onclick="controls.hideIncorrect()" class="hide puzzlealert">The solution to the puzzle is incorrect. Please try again.</button>
<div id="pp-canvas-controls">
<button type="button" onclick="puzzle.clear()">Clear</button>
<button type="button" onclick="controls.check()">Check</button>
<button type="button" onclick="puzzle.reveal()">Reveal</button>
<button type="button" id="pencil0" class="imgbutton" onmousedown="controls.changePencilColor(0)"><img src="public/images/pp-canvas/blue.png" alt="Blue"></button>
<button type="button" id="pencil1" class="imgbutton" onmousedown="controls.changePencilColor(1)"><img src="public/images/pp-canvas/red.png" alt="Red"></button>
<button type="button" id="pencil2" class="imgbutton" onmousedown="controls.changePencilColor(2)"><img src="public/images/pp-canvas/green.png" alt="Green"></button>
<button type="button" id="pencil3" class="imgbutton" onmousedown="controls.changePencilColor(3)"><img src="public/images/pp-canvas/orange.png" alt="Orange"></button>
<button type="button" id="pencil4" class="imgbutton" onmousedown="controls.changePencilColor(4)"><img src="public/images/pp-canvas/purple.png" alt="Purple"></button>
<button type="button" id="pencil5" class="imgbutton" onmousedown="controls.changePencilColor(5)"><img src="public/images/pp-canvas/grey.png" alt="Grey"></button>
<button type="button" id="eraser" class="imgbutton" onmousedown="controls.takeEraserInHand()"><img src="public/images/pp-canvas/eraser.png" alt="Eraser"></button>
</div>

<!-- Scripts for testing locally -->
<!-- All example puzzles -->
<script src='spokes-example.js'></script>
<script src='path-example.js'></script>
<script src='small-example.js'></script>
<script src='battleships-example.js'></script>
<script src="all-shapes-example.js"></script>

<script src='bootstrap-interactive-puzzle.js'></script>
</body>
</html>



And the relevant code in JS:

InteractivePuzzle = function (gencode, puzcode, width, height, targetDomElementName, puzzleId,pencilColors) {
var start = new Date().getTime();
var modelHelper = new PuzzleModelHelper();
var shapePainter = new ShapePainter();

var puzzleState = new PuzzleState();
var reporter = new Reporter(puzzleId);
var storage = new PuzzleStorage(puzzleId);
var puzzleActionListener;

var shapeFactory = new ShapeFactory(pencilColors.defaultPencilColorId);
var shapeModifiers = new ShapeModifiers();
var puzzleModelSearch = new PuzzleModelSearch(gencode, puzcode, shapeModifiers, shapeFactory);
var model = new PuzzleModel(pencilColors.defaultPencilColorId, puzzleModelSearch, modelHelper);
var userActivityListener = new UserActivityListener(model, reporter, storage);
var viewEventHandler = {
handleLeftMouseDown: function (dynamicId, leftMouseShapesGroup, rightMouseShapesGroup) {
puzzleActionListener.handleLeftMouseDown(dynamicId, leftMouseShapesGroup, rightMouseShapesGroup);
},
handleRightMouseDown: function (dynamicId, leftMouseShapesGroup, rightMouseShapesGroup) {
puzzleActionListener.handleRightMouseDown(dynamicId, leftMouseShapesGroup, rightMouseShapesGroup);
},
handleTouchStart: function (dynamicId, leftMouseShapesGroup, rightMouseShapesGroup) {
puzzleActionListener.handleTouchStart(dynamicId, leftMouseShapesGroup, rightMouseShapesGroup);
},
handleTouchMove: function (dynamicId, leftMouseShapesGroup, rightMouseShapesGroup) {
puzzleActionListener.handleTouchMove(dynamicId, leftMouseShapesGroup, rightMouseShapesGroup);
},
handleTouchEnd: function (dynamicId, leftMouseShapesGroup, rightMouseShapesGroup) {
puzzleActionListener.handleTouchEnd(dynamicId, leftMouseShapesGroup, rightMouseShapesGroup);
},
handleLeftMouseUp: function (dynamicId, leftMouseShapesGroup, rightMouseShapesGroup) {
puzzleActionListener.handleLeftMouseUp(dynamicId, leftMouseShapesGroup, rightMouseShapesGroup);
},
handleRightMouseUp: function (dynamicId, leftMouseShapesGroup, rightMouseShapesGroup) {
puzzleActionListener.handleRightMouseUp(dynamicId, leftMouseShapesGroup, rightMouseShapesGroup);
},
handleMouseEnter: function (dynamicId, leftMouseShapesGroup, rightMouseShapesGroup) {
puzzleActionListener.handleMouseEnter(dynamicId, leftMouseShapesGroup, rightMouseShapesGroup);
},
handleMouseLeave: function (dynamicId, leftMouseShapesGroup, rightMouseShapesGroup) {
puzzleActionListener.handleMouseLeave(dynamicId, leftMouseShapesGroup, rightMouseShapesGroup);
}
};
var userActivityHandler = new UserActivityViewEventHandler(userActivityListener);
var viewEventHandlers = [viewEventHandler, userActivityHandler];
var puzcodeElementPainter = new PuzcodeElementPainter(shapePainter);
var puzzleViewPart = new PuzzleViewPart(puzcodeElementPainter, shapePainter, modelHelper, viewEventHandlers);
var stageFactory = new StageFactory(targetDomElementName, width, height);
var shapesView = new ShapesView(modelHelper,puzcodeElementPainter,pencilColors.pencilColors);
var view = new InteractivePuzzleView(model, pencilColors.pencilColors, puzzleViewPart,stageFactory, shapesView);

var presenter = new PuzzlePresenter(view, model,userActivityListener);
var puzzleActionEngine = new PuzzleActionEngine(model, puzzleState);
puzzleActionListener = new PuzzleActionListener(view, model, puzzleActionEngine);
var backend = new PuzzleBackend(puzzleId);

if (storage.hasSavedPuzzle()) {
presenter.revealSolution(storage.loadSavedPuzzle());
} else {
reporter.noteClean();
}


var end = new Date().getTime();
var time = end - start;
console.log('Rendering puzzle completed in ' + time + ' ms');

return {
check: function (solutionCorrectCallback,solutionIncorrectCallback) {
var solutionToCheck = model.generateSolutionShortCode();
var callBackWithReporting = function() {
backend.sendReport(reporter.report());
solutionCorrectCallback();
};
reporter.noteActivity();
reporter.noteCheck();
backend.checkSolution(puzzleId, solutionToCheck,callBackWithReporting,solutionIncorrectCallback);
},
reveal: function () {
var puzzleCallback = function(puzzle) {
model.currentPencilColor = pencilColors.defaultPencilColorId;
presenter.revealSolution(puzzle.solutionRepresentation);
reporter.noteActivity();
reporter.noteRevealed();
};
backend.loadPuzzleById(puzzleId, puzzleCallback);
},
takeEraserInHand: function() {
puzzleState.takeEraserInHand();
},
changePencilColor: function (colorId) {
reporter.noteActivity();
model.currentPencilColor = colorId;
puzzleState.takePencilInHand();
},
clear: function () {
$('#pp-clear').removeClass('hide');
$('#pp-canvas-controls').addClass('hide');
},
clearPencilColor: function (colorId) {
presenter.clearShapesByPencilColor(colorId);
}
};
};



Sorry for the mess, hope you can use it. I actually installed Greasemonkey, but my concentration isn't enough nowadays to code for it.
I happened to find out that the functionality is already implemented: there is a function that erases a certain colour. If I remember correctly (sorry, it was years ago) I even sent Thierry a patch that experimentally opened extra buttons from clicking Clear. At the same time it served as a confirmation, because now Clear is very dangerous. Actually I've hidden it with my uBlock.

Anyway, at that time Thierry was getting even busier with out-of-site life, so I guess this has been buried completely.
(sorry for hiatus, I was away a long time and didn't notice there was discussion)

I agree. I didn't publish this for its sensibility as a puzzle, just for its merits as a theme. I wouldn't have done even that if this was longer - now this remains somewhat in control.

FWIW, now I haven't solved this myself
(sorry, can be deleted)
I used GIMP's help, that is: took a screenshot and started bifurcating. It grew steadily, but with the site's own tools I don't think i'd have made it. (obviously paper and pencil would work too)
I took a new look at this, and I agree with connect4. Half of it was really easy to solve, but then I'm in the same situation. I took one quick bifurcation that ascertained some segments, but now I'm stuck again.
Nothing serious, because in Fences the bifurcations are really easy to make (meaning, possible with the page's own tools) but I agree with 3 stars.
You could start with:
http://puzzlepicnic.com/community/posts/list/2381.page
My starting post here was actually an error - I decided to put the issue in the bug section. Just copied the link of the puzzle.
I made exactly the same mistake that you did.
In Alphametic Puzzle #5943, at the checking phase I got "incorrect". I took screenshot and re-entered the numbers to ascertain that I put the right ones there. It turned out that I had made the correct solution, but hadn't put numbers in the inequality at the right. So, would it be wise to have fixed (non-enterable) letters for these? Or else make the check procedure highlight empty places?
Number: Puzzle #5943
Genre: Alphametic
Author: nyancharov
Appeared at: May 24, 2018
 
Profile for JHe -> Messages posted by JHe [109] Go to Page: 1, 2, 3, 4, 5, 6, 7, 8 Next 
Go to:   
Powered by JForum 2.1.6 © JForum Team