Entry #1 in the Game and Puzzle Series – Simple Sudoku
In this post, I offer up a simple sudoku puzzle. Simple just means that there is only one puzzle at this time and there are no special controls that may be found in other sudoku puzzle games.
Not sure how to play? All you have to do is make sure that every 3×3 block, 9-square row, and 9-square column contain the numbers 1 through 9 once and only once. Select the number on the right and then select the box you would like the number to appear in. Your active number will appear in the box you clicked on. Some numbers have been filled in for you but only the empty boxes at the beginning of the round will accept entries.
Check the status of the puzzle by clicking the check button and reset all the tiles to repeat the puzzle.
Enjoy – and please let me know if you discover any bugs.
Thank you.
As with any project like this – there are often multiple ways to arrive at the same result.
Since the question is somewhat broad, I am afraid my answer will also be somewhat broad.
Perhaps it will be enough to get you started.
I chose to compare two arrays.
The first array holds the initial game board and the second array holds the solution.
Each of the 81 boxes of the game board is a multi-state object. Selecting the number on the side sets a variable which is used to change the state of the chosen box to match the selected number. Each box on the game board, when clicked, will also set the selected value to the corresponding position in the first array.
When the check button is pressed – the modified game board array is compared to the solution array. For every index match in the two arrays, a point is awarded to a variable tracking the number of matches. If that value equals 81 – you win.
Hopefully that makes some sense.
Thank you for the reply. I appreciate it I’m still an amateur when it comes to Captivate.
I currently have the skeleton up. I’m actually thinking of doing a drag and drop interactive, however, I can’t seem to have the buttons on the side (drag source) to be infinite for unlimited dragging.
You mentioned the comparing of two arrays. I assume this is Javascript related? If so, I’m wondering if there are other ways to do this?
Yes – this project makes extensive use of JavaScript to do the heavy lifting.
For a drag and drop style version, you would likely need at least as many draggables of each number as there are spaces left to fill in the puzzle for each number but no more than 9 – of course. Also be careful of the spacing between boxes so that there isn’t any overlap. That could cause problems.
I suppose you might accomplish a similar end using advanced actions but I think it would be a bit tedious creating all of the action statements. You may also need way more variables for tracking without an array.
One example to that point…
I use a for loop to check all 81 boxes for the correct number entry and to perform some other conditional tasks.
(Check entry vs answer, if correct display the green highlight and increment variable, if incorrect display the red highlight, when complete, if the variable is equal to 81 – you win, else you lose so display that accordingly, finally after three seconds, remove the highlighting from all boxes.)
This is 26 lines of code whereas building that in an advanced action might be hard to keep track of. You do have the WHILE option in your advanced action dropdown so maybe that could be taken advantage of but I honestly cannot speak to the reliability of that for a case like this.
Thank you for the prompt response!
That was the same conclusion I had in mind initially. Hence I had to seek advice from others.
For now, I would probably be creating 9 boxes for each number ranging from 1-9 and see how it goes.
If I do have more time, I would probably go read up more on Javascript for Captivate seeing as it helps open up more possibility.
Once again, thank you for your reply. It was an interesting read!
Try this link – it is the one my browser has from the pending post.
Hi Greg,
I wanted to check out your game, but on clicking the triangle button I just get a new browser window with this error message: “This XML file does not appear to have any style information associated with it.”, and some error code. Seems to be the same issue that I run into myself when trying to include a demo into a blog post here recently (described here: https://elearning.adobe.com/2021/05/inserting-captivate-projects-as-a-working-demo-to-posts-on-this-community/).
Did you check yourself, and does your game open for you ok? Maybe it’s just my receiving end, though I can launch other launch other projects posted here just fine.
You must be logged in to post a comment.