viresh-ratnakar / exolve

Online interactive crossword software in JavaScript
MIT License
74 stars 15 forks source link

No reveal buttons but need check buttons #87

Closed SinghGauravKumar closed 1 year ago

SinghGauravKumar commented 1 year ago

First of all, incredible work! This has been awesome ride. I wonder if you are familiar with any python implementations of dense crossword filling algorithms (take a list of words and fit them on a X by X grid)?I have seen a few but don't think they do a good job.

Now the main issue:

I want to tell the player if they have done anything wrong, but using the Check buttons. But I don't want to reveal the answer. Obviously they can look into the source code to see that, but that is besides the point. I saw an option to replace all the letters of the puzzle with Os and that disables Reveal buttons. But that would disable check buttons too, right? How would the puzzle check for correctness when the ground truth is missing?

viresh-ratnakar commented 1 year ago

Thanks!

Sorry, not familiar with the filling implementation that you're looking for.

You can easily hide the "Reveal" buttons and do any other customizations by using a customizeExolve() function.

For example, this 3x3 puzzle will not render the Reveal* buttons:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="https://viresh-ratnakar.github.io/exolve-m.css?v1.47"/>
<script src="https://viresh-ratnakar.github.io/exolve-m.js?v1.47"></script>
<title>Exolve: Reveal Buttons Hidden</title>
</head>
<body>
<script>
function customizeExolve(puz) {
  puz.revealButton.style.display = 'none';
  puz.revealAllButton.style.display = 'none';
}
createExolve(`
exolve-begin
  exolve-title: Exolve: Reveal Buttons Hidden
  exolve-width: 3
  exolve-height: 3
  exolve-grid:
    ACE
    R.V
    TOE
  exolve-across:
    1 Top card (3)
    3 Foot part (3)
  exolve-down:
    1 Creative work (3)
    2 The night before (3)
exolve-end
`);
</script>
</body>
</html>