Go Back   Freethought Forum > The Amphitheater > The Colosseum

Reply
 
Thread Tools Display Modes
  #51  
Old 03-21-2022, 11:36 AM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

Quote:
Originally Posted by JoeP View Post
Why is the 1 marked impossible here? It becomes possible (and indeed correct!) only when I erase the other 1 guess at the far end.

The impossible marking is because you had another (non-yellow) 1 on the same row.

The impossible marking doesn't mean that the number you just entered is actually wrong - just that it conflicts with another (non-yellow) number on the same row/column/block.

The idea is to stop you just putting the same number, say 1, in every blank position along the row. Then that row would get marked with the correct 1 shown green and all the others yellow. That seems like cheating to me - I know it would be penalized with a high yellow score, but I thought it better to rule it out.

I suppose I could bypass the impossible locking when, and only when, the number you've just entered completes a row, column, or block - that way the row would be marked and your yellow score would be bumped by one, instead of your black score.

I'll soon be adding an options menu, so I could make one of the options 'disable impossible marking', if you think that's a good idea.

I'll swap the colours to your suggestions now and upload in the next few minutes. Let's see what any other players think.

ETA: the darker green made it harder to spot the boxshadow (currently selected square) when it happened to be on a green cell. I've made that a bit darker now too. Any ideas for better/alternative ways of indicating the currently selected square? Once I make different themes available, the selected square might be hard to spot in some themes.
__________________

Last edited by ceptimus; 03-21-2022 at 11:49 AM.
Reply With Quote
Thanks, from:
Ari (03-21-2022)
  #52  
Old 03-21-2022, 01:54 PM
JoeP's Avatar
JoeP JoeP is online now
Solipsist
 
Join Date: Jul 2004
Location: Kolmannessa kerroksessa
Gender: Male
Posts: XXXVMMCXXI
Images: 18
Default Re: Sudokle

Quote:
Originally Posted by ceptimus View Post

The impossible marking is because you had another (non-yellow) 1 on the same row.

The impossible marking doesn't mean that the number you just entered is actually wrong - just that it conflicts with another (non-yellow) number on the same row/column/block.
The word "impossible" is inappropriate then. I agree with marking actually impossible guesses that conflict with a green - the idea of limited "lives" for such in a harder mode would work well.

If you're going to mark conflicts, then it should be done for yellows as well for consistency, and as with yellows it shouldn't prevent moving to other squares - in particular moving to the conflicting white square to change it.
__________________

:roadrun:
Free thought! Please take one!

:unitedkingdom:   :southafrica:   :unitedkingdom::finland:   :finland:
Reply With Quote
  #53  
Old 03-21-2022, 02:35 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

Agreed "impossible" is an inappropriate name. But that word doesn't appear in any game instructions yet - because there are none! I'll change the label in the game now to Conflicted. If and when we think of a better name, I'll change it to that, and also put that name in the JavaScript comments.

Don't agree with your comment about marking a conflict yellow though, or a conflict with a yellow cell grey. Imagine you put a 6 in the cell immediately below the greyed-out one in your example. In this case there's a yellow 6 two cells across. But that's fine because we know that the yellow 6 is wrong! The same would be true if we put a 6 in the next cell across (below the green 4): that 6 would actually become green when eventually marked, so marking it yellow or grey, even temporarily, would be nonsensical.

Green: known to be correct
Yellow: known to be wrong
Grey: conflicts with another non-yellow in the same group
White: could be right or wrong (by inspection of the puzzle, you may be certain which it is, but because it's not part of a completed group of nine, it's not yet been 'marked' by the game engine).
__________________

Last edited by ceptimus; 03-21-2022 at 02:50 PM.
Reply With Quote
Thanks, from:
JoeP (03-21-2022)
  #54  
Old 03-21-2022, 02:47 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

With themes, what to do about the 'score sharing' thing? At the moment it uses the black and yellow unicode squares, but if you're using a dark theme, then your colours for those might be grey and purple. But if I pick the nearest unicode colour to the ones used in the theme, then the scores won't have a consistent format.
__________________
Reply With Quote
  #55  
Old 03-21-2022, 04:37 PM
Ari's Avatar
Ari Ari is online now
I read some of your foolish scree, then just skimmed the rest.
 
Join Date: Jan 2005
Location: Bay Area
Gender: Male
Posts: XMDCCCLXXIV
Blog Entries: 8
Default Re: Sudokle

Quote:
Originally Posted by ceptimus View Post
The idea is to stop you just putting the same number, say 1, in every blank position along the row. Then that row would get marked with the correct 1 shown green and all the others yellow. That seems like cheating to me
And is exactly what I tried to do in one of the earlier iterations.
Reply With Quote
Thanks, from:
ceptimus (03-21-2022)
  #56  
Old 03-22-2022, 08:57 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

Here's an example of the kind of elephant-traps built into JavaScript.

I store the clue squares in the database concatenated into a string. The numbers can be 0 to 80 for the 81 squares, so to make them easy to parse, I store them all as double digits so if the clue squares were 1, 6, 18, 23, ... that would be stored as "01061823..."

Now JavaScript is very willing, keen even, to change strings into numbers or vice-versa so when the string is split up into pairs of digits, it's happy to accept those as numbers. And, in fact, the above example works perfectly.

But JavaScript treats number strings that begin with 0 as octal (base 8), so if my program happened to pick squares 8 and 9, they would be stored as '08' or '09' which aren't valid octal numbers. JavaScript doesn't make a fuss about them though* it just silently converts them both to zero.

Once you've discovered the bug, you just change the strings to use leading spaces instead of leading zeros, or write your code to strip leading zeros from string-representations of numbers.

Experienced JavaScript coders are well aware of this potential bug (and numerous similar weird bugs), but it's left as a trap for newbie JavaScript programmers. The justification given by the language maintainers is that there are billions of web pages that use JavaScript out there already, and they may rely on this quirky way of interpreting strings, so the language can't be retrospectively altered.

*unless you switch on the 'strict' mode which was only introduced in ECMAScript version 5
__________________
Reply With Quote
Thanks, from:
Ari (03-22-2022), JoeP (03-22-2022), viscousmemories (03-23-2022)
  #57  
Old 03-22-2022, 10:10 PM
JoeP's Avatar
JoeP JoeP is online now
Solipsist
 
Join Date: Jul 2004
Location: Kolmannessa kerroksessa
Gender: Male
Posts: XXXVMMCXXI
Images: 18
Default Re: Sudokle

Strict mode ftw.
__________________

:roadrun:
Free thought! Please take one!

:unitedkingdom:   :southafrica:   :unitedkingdom::finland:   :finland:
Reply With Quote
Thanks, from:
ceptimus (03-22-2022)
  #58  
Old 03-22-2022, 11:41 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

I've put it on now. That was weird too. Nearly all of the JavaScript I have in a file named Sudoffle.js, so I put "use strict"; up at the start of that, outside of any functions. Made no difference.

Then I remembered that the first bit of the JavaScript is written by the PHP program, where it passes data it's read from the database to the JavaScript - so I made the PHP print "use strict"; into the HTML immediately following the {script} tag, and then it started to do its stuff.

ETA: whoops! Don't put {script} into your post (with angle brackets) if you're in the HTML group. That screwed up the forum, and took the usual post-number tweaking trick to fix. :phew:
__________________
Reply With Quote
Thanks, from:
JoeP (03-23-2022)
  #59  
Old 03-22-2022, 11:58 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

I've been working on a themes editor today. It has a left hand 'side menu' thing with all the colour values in an editable table, and then displays a static non-working Sudoffle example using those colours on the main part of the page.

When you get a scheme you like, you can save it to the database, with a name. I'll make it so you can't overwrite an existing scheme, so if you edit a scheme named, say 'Dark' and save it, then it will be saved as Dark(1) etc.

Once we've got a few themes that we like, I'll make them available in the game.

Reason it's taking so long is that I've rewritten the main grid display to all happen on a HTML canvas instead of a bunch of regular HTML blocks in a table. That gives me finer control over things like "shadows" for highlighting the currently selected square, which might otherwise be invisible with some schemes. I can also add some little 'pencil marks' inside the blank squares (if the user turns it on).

The canvas doesn't look as nice as the existing display if you zoom right in close - that's because once the numbers are written to a canvas, they become fixed pixels on the canvas rather than continually resizing text when you zoom. There are ways of fixing that, but they seem very complex to me.
__________________
Reply With Quote
Thanks, from:
Ari (03-23-2022), JoeP (03-23-2022), viscousmemories (03-23-2022)
  #60  
Old 03-23-2022, 11:20 AM
JoeP's Avatar
JoeP JoeP is online now
Solipsist
 
Join Date: Jul 2004
Location: Kolmannessa kerroksessa
Gender: Male
Posts: XXXVMMCXXI
Images: 18
Default Re: Sudokle

Quote:
Originally Posted by ceptimus View Post

ETA: whoops! Don't put {script} into your post (with angle brackets) if you're in the HTML group. That screwed up the forum, and took the usual post-number tweaking trick to fix. :phew:
Well now you've made me want to try it. Any resulting damage will be your fault :hmph:
__________________

:roadrun:
Free thought! Please take one!

:unitedkingdom:   :southafrica:   :unitedkingdom::finland:   :finland:
Reply With Quote
Thanks, from:
ceptimus (03-23-2022)
  #61  
Old 03-23-2022, 11:29 AM
JoeP's Avatar
JoeP JoeP is online now
Solipsist
 
Join Date: Jul 2004
Location: Kolmannessa kerroksessa
Gender: Male
Posts: XXXVMMCXXI
Images: 18
Default Re: Sudokle

Click here to break the forum
__________________

:roadrun:
Free thought! Please take one!

:unitedkingdom:   :southafrica:   :unitedkingdom::finland:   :finland:
Reply With Quote
  #62  
Old 03-23-2022, 11:30 AM
JoeP's Avatar
JoeP JoeP is online now
Solipsist
 
Join Date: Jul 2004
Location: Kolmannessa kerroksessa
Gender: Male
Posts: XXXVMMCXXI
Images: 18
Default Re: Sudokle

This is all ceptimus's fault
__________________

:roadrun:
Free thought! Please take one!

:unitedkingdom:   :southafrica:   :unitedkingdom::finland:   :finland:
Reply With Quote
  #63  
Old 03-24-2022, 10:54 AM
slimshady2357's Avatar
slimshady2357 slimshady2357 is offline
forever in search of dill pickle doritos
 
Join Date: Jul 2004
Posts: VMCII
Blog Entries: 6
Images: 52
Default Re: Sudokle

So I did some of today's puzzle on a scrap piece of paper because I like to scribble little notes in the squares as I go. I ended up solving it (I thought!) and entered it into the web page. This is what I got:

ScreenHunter_591 Mar. 24 09.49.gif

I've gone over that twice now and can't find a contradiction. Is this something that can happen often, there be 2 solutions to the same starting numbers? Or am I missing something and my solution isn't a valid sudoku?
__________________
Reply With Quote
Thanks, from:
ceptimus (03-24-2022)
  #64  
Old 03-24-2022, 02:52 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

It's a well known problem but each Sudoffle does only have one valid solution providing you don't ignore the 'yellow clues' you're shown at the start.

And your 'solution' must be valid (when you ignore the opening yellows). You'd never be allowed to enter it otherwise: the moment you enter a number that clashes with another (non-yellow) number in a row, column, or block, you're locked on that (grey) cell till you change or delete your entry.

It's to do with how many clues you're given, and how they're chosen. Obviously if you were only given an handful of clues, there might be millions of completed grids that satisfy those clues. It's known that the minimum number of clues required to guarantee a unique solution is 17 - but those clues have to be carefully chosen, and a 17-clue Sudoku is insanely difficult for a person (as opposed to a computer) to solve.

Sudoffle currently generates a 'solved' grid, then chooses 32 squares at random to reveal as green clues. But it then goes on to solve the puzzle using just those clues: it usually finds more than one solution, so it then adds a yellow clue and tries again. It keeps adding yellow clues till the solution is unique. In the case of Sudoffle 10, the original puzzle shows you a yellow '2' at the position of the top left yellow '2' of your solution.

So although you have a button to 'Hide squares marked incorrect' you shouldn't do that to begin with if you want the solution to be unique. I suppose rather than just making the button disappear when you click it, it should hide the yellow squares and relabel the button to 'Show squares marked incorrect'. The pencil marks thing will also let you keep track of the incorrect squares, once that option is added.

I could alter the puzzle generator to just choose a different set of 32 green clues that does result in a unique solution, or I could make it add extra green squares to rule out duplicate solutions. But I quite like the novelty of having both sorts of clue - it's what makes Sudoffle different from regular vanilla Sudoku.
__________________
Reply With Quote
Thanks, from:
JoeP (03-24-2022), slimshady2357 (03-24-2022), specious_reasons (03-24-2022)
  #65  
Old 03-24-2022, 04:19 PM
slimshady2357's Avatar
slimshady2357 slimshady2357 is offline
forever in search of dill pickle doritos
 
Join Date: Jul 2004
Posts: VMCII
Blog Entries: 6
Images: 52
Default Re: Sudokle

Cheers for that detailed explanation :1thumbup:

I did indeed hide the yellow squares at the start as I thought they were just a distraction :giggle:

Now I know how to use them.

Quote:
I suppose rather than just making the button disappear when you click it, it should hide the yellow squares and relabel the button to 'Show squares marked incorrect'.
That would be cool if not too difficult :)
__________________
Reply With Quote
Thanks, from:
ceptimus (03-24-2022)
  #66  
Old 03-24-2022, 06:14 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

Quote:
Originally Posted by slimshady2357 View Post
That would be cool if not too difficult :)
It was a bit tricky because you can sometimes get shown a different yellow for the same square. I've made it show the first yellow revealed for a square when that happens. I think it's working okay now. :crossed:
__________________
Reply With Quote
  #67  
Old 03-24-2022, 11:46 PM
JoeP's Avatar
JoeP JoeP is online now
Solipsist
 
Join Date: Jul 2004
Location: Kolmannessa kerroksessa
Gender: Male
Posts: XXXVMMCXXI
Images: 18
Default Re: Sudokle

Quote:
Originally Posted by ceptimus View Post
It's a well known problem but each Sudoffle does only have one valid solution providing you don't ignore the 'yellow clues' you're shown at the start.
All the more recent to have a mouseover display of previous yellows (I don't think that's in yet?)

Quote:
Originally Posted by ceptimus View Post
But I quite like the novelty of having both sorts of clue - it's what makes Sudoffle different from regular vanilla Sudoku.
It's not the only difference - the yellow/green highlighting is one thing - and having a name that incorporates a smilie is a pretty key difference.

---

Colours are looking good.
Suggestion: now that the cells don't behave like input elements, you could change from cursor: text to :{:cursor: pointer:}:.
eta: over white cells as well as ones with numbers in already
__________________

:roadrun:
Free thought! Please take one!

:unitedkingdom:   :southafrica:   :unitedkingdom::finland:   :finland:

Last edited by JoeP; 03-24-2022 at 11:57 PM.
Reply With Quote
Thanks, from:
ceptimus (03-25-2022)
  #68  
Old 03-25-2022, 11:39 AM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

It's not really using a cursor - it just adds a sort of inner box shadow on the selected cell: I think when playing on a phone or tablet that's all that's necessary. When playing on a PC, I tend to use the cursor keys to move the 'selected cell' and just ignore the mouse pointer, which could be anywhere - usually hovering outside the grid on the background somewhere.

I don't think I really understand what you mean. :dunce: Can you explain more?
__________________
Reply With Quote
  #69  
Old 03-25-2022, 02:25 PM
JoeP's Avatar
JoeP JoeP is online now
Solipsist
 
Join Date: Jul 2004
Location: Kolmannessa kerroksessa
Gender: Male
Posts: XXXVMMCXXI
Images: 18
Default Re: Sudokle

Sorry, I'm using the html/css meaning of "cursor" which is really the mouse pointer. Mouse over the smilied bit in my previous post, and quote to see what I mean.
__________________

:roadrun:
Free thought! Please take one!

:unitedkingdom:   :southafrica:   :unitedkingdom::finland:   :finland:
Reply With Quote
Thanks, from:
ceptimus (03-25-2022)
  #70  
Old 03-25-2022, 09:01 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

I joined a Sudoku forum and posted about Sudoffle there, hoping to get some feedback from some Sudoku experts.
But that forum is set up with an ancient version of MySQL (4.something) It could probably still do the job though if it was configured correctly. If you try to post your Sudoffle results (or presumably any other of the -dle game results that use Unicode for the coloured blocks) then you get a MySQL error, and your post is rejected. :bleh:

I didn't make a fuss about it there, because I'm only a newbie, and still on probation. :innocent:
__________________
Reply With Quote
Thanks, from:
Ari (03-25-2022), JoeP (03-25-2022), slimshady2357 (03-26-2022), specious_reasons (03-25-2022)
  #71  
Old 03-25-2022, 10:22 PM
JoeP's Avatar
JoeP JoeP is online now
Solipsist
 
Join Date: Jul 2004
Location: Kolmannessa kerroksessa
Gender: Male
Posts: XXXVMMCXXI
Images: 18
Default Re: Sudokle

What I'm hearing you say is that we should all join and complain like hell.
__________________

:roadrun:
Free thought! Please take one!

:unitedkingdom:   :southafrica:   :unitedkingdom::finland:   :finland:
Reply With Quote
Thanks, from:
ceptimus (03-25-2022)
  #72  
Old 03-25-2022, 11:17 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

:nope: The strange thing is, the forum all looks up to date. It's only when I tried to post my Sudoffle score and saw the MySQL error with the version 4.x that I knew the site is built on ancient foundations. That MySQL server version was from 2004, or earlier. MySQL is currently on version 8, and there are open source equivalents, such as MariaDB, if you're wary of Sun and Oracle.

In other news, the theme designer seems to be working. I'll most likely upload it tomorrow. It lets you modify and save themes in the database, and then they are visible to all. You can delete or overwrite themes you've created yourself in the same session, but you can't modify or delete other themes. If you try to overwrite a theme with the same name from another person (or you in an earlier session), the designer just appends a (1) or (2) or whatever after the name - similar to the way downloads get renamed if you download the same file more than once.

Once we've agreed on a nice set of themes, I can delete any crappy or duplicate ones, lock down a 'currently approved set', and then alter the Sudoffle program so that it allows players to choose which one to use.
__________________

Last edited by ceptimus; 03-25-2022 at 11:28 PM.
Reply With Quote
  #73  
Old 03-26-2022, 11:47 PM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

Sudoffle Theme Designer

Please make some nice themes everyone! :please:

I'm crap at it, but I made a couple of examples to get you started.

If you're not used to HTML colours, they're just a # followed by six hex digits (0 - 9 plus A-F). The first two specify the amount of red with 00 being none and ff being full red, the next two are for green, and the last two blue.
The alpha for the selected box is how transparent it is - a number between zero and 1 inclusive. 0.0 means fully transparent (invisible) 1.0 is fully opaque.

You should be able to modify and delete themes you created yourself - at least those created on the same PC or tablet or whatever in the same session. You shouldn't be able to modify or delete themes created by others: delete attempts will just be ignored, and save will save a new theme with a (1) or (2) or whatever appended to the name.
__________________
Reply With Quote
Thanks, from:
JoeP (03-27-2022)
  #74  
Old 03-27-2022, 01:27 AM
ceptimus's Avatar
ceptimus ceptimus is offline
puzzler
 
Join Date: Aug 2004
Location: UK
Posts: XVMMDCCCXXVII
Images: 28
Default Re: Sudokle

Sudoffle Beta #13
⬛ 1
🟨 2
⏲️ 19m0s
Sudoffle
__________________
Reply With Quote
  #75  
Old 03-27-2022, 10:34 AM
JoeP's Avatar
JoeP JoeP is online now
Solipsist
 
Join Date: Jul 2004
Location: Kolmannessa kerroksessa
Gender: Male
Posts: XXXVMMCXXI
Images: 18
Default Re: Sudokle

Battenberg :giggle:
__________________

:roadrun:
Free thought! Please take one!

:unitedkingdom:   :southafrica:   :unitedkingdom::finland:   :finland:
Reply With Quote
Thanks, from:
ceptimus (03-27-2022)
Reply

  Freethought Forum > The Amphitheater > The Colosseum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

 

All times are GMT +1. The time now is 09:44 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Page generated in 0.24765 seconds with 14 queries