topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday December 3, 2025, 6:58 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 10 11 12 13 14 [15] 16 17 18 19 20 ... 1514next
351
Developer's Corner / Re: Constructing a minimal Sudoku puzzle
« Last post by mouser on July 28, 2021, 01:49 PM »
You know the famous Knuth programming quote: "premature optimization is the root of all evil" (which I don't agree with -- I think code duplication gets that spot).

My first strategy for trying to understand code like this would be to remove wherever possible all the clever optimization stuff.  Like the lines 2-26 in solve serve only the purpose of reordering the indices to check to get faster results; i'd try to get rid of that kind of thing until i knew it all worked well first.

After it all works then worry about speeding it up.
352
Developer's Corner / Re: Constructing a minimal Sudoku puzzle
« Last post by mouser on July 28, 2021, 01:45 PM »
Your solve() function looks a little problematic to me.

First, just as a matter of clarity -- you are returning an int variable "solutions" which seems like its suggesting the number of solutions found, but this isnt quite right is it.. You really just want to return a bool of true if a solution was found, or false if not.  The recursive calls must eventually end in a true or a false, which gets propagated back up to be returned.  You never want to find more than 1 solution, and your algorithm explicitly stops searching once it finds one solution.  Having it look like its adding up solution counts makes it harder to understand.  This makes lines like 40 particularly confusing since you really should be saying "return false" -- there is no way to get there with a solutions>0.

And now looking more into the loop, the idea is to recursively fill in one value, and then call solve on the new grid with the filled in value, each recursive call filling in one additional square of the grid.
(you are doing some optimization on what ORDER you try to fill in squares based on looking at ones with least options first -- maybe document the reasoning and approach more; that's not important).

So the idea of this recursion is that it should return FALSE if you ever call solve() with a grid where there is a hole (blank square) that CANNOT be filled in.  That false will return to the caller who will continue looping checking for a different value to put into the square before it recursively checks for another solution.  That looks right to me.

And then you need it to return TRUE when it has SOLVED the grid COMPLETELY.

But looking at the code, i see what MIGHT be a problem.

Your last lines of solve say "       
# if we got this far then we've solved it!        solutions += 1         return solutions
"

But let's look how we can get down there.
One way is if there are no more holes -- that's what we want.  When there are no holes, return TRUE, we found a solution.
But also i think you can get there if your PRELIMINARY sorting operations identifying possibilities creates a situation where some illegal spot has no good options.  this should NOT be returning a true case(!)

I think the better solution would be to set some flag line at line 14: flagFoundHole = true;

then somewhere before line 18 you could just say
If (!flagFoundHole) {
// no holes found, so this represents a solution!
return true;
}
353
Developer's Corner / Re: Constructing a minimal Sudoku puzzle
« Last post by mouser on July 28, 2021, 12:12 PM »
Maybe im missing something since it seems like it would break everything if it was missing, or maybe you didn't show all the code, but in find_givens() function, line 21 starts a loop checking if there are solutions with the alternative digits.

In the loop you force the test value, and check if there is a solution..
And at the end of the loop if you DID find other solutions, you force the value back and then set it as a given square.

BUT what you dont do is at the end of that if you DONT find any solutions, is FORCE that value to a hole (value 0).. so in the code you show above it will be left as bad value (the last value you checked in the loop), rather than marked as a hole.
Did you just forget to show that code or am i missing something?

354
Developer's Corner / Re: Constructing a minimal Sudoku puzzle
« Last post by mouser on July 28, 2021, 12:00 PM »
I'm not very familiar with Sodoku solving/generating, but I'll give the paper a look and try to comment.

But maybe a quick PRELIMINARY thought experiment is worth doing to clarify what you are seeing.

As I understand the basic gist of the algorithm is that you incrementally blank out squares, and check to make sure (by running a solver) that there is still only a unique solution to the puzzle with the square blanked out.  If there are multiple solutions with that square blanked out, you must force it to be a given, and try looking for another square to blank out (dig a hole).

So, this algorithm guarantees that the puzzle, with its givens and its holes (blanks) is UNIQUELY SOLVABLE.

But it doesn't really guarantee that the puzzle is MINIMAL.  I don't think it claims to, does it?

It's not doing a brute force search for all POSSIBLE ways to dig holes.. It is in fact going through an ORDERED list of possible squares to dig, checking them one at a time, and when it finds one it can dig (leave blank), it makes it blank going forward.

This does not guarantee a minimal set of givens.  Depending on what holes (blanks) you decide on early, you may be forced into having more or less holes in the rest of the puzzle.

You could use it to find minimal puzzles if you ran it once for every possible sequence of potential holes, and kept the one that resulted in the fewest givens.

---

Does that make sense? Or am I missing something?

I just think it's important to understand that the algorithm doesn't seem to be promising to generate minimal puzzles.

355
Developer's Corner / Re: Constructing a minimal Sudoku puzzle
« Last post by mouser on July 28, 2021, 11:23 AM »
"Unit: Any nine squares that compose a row, column, or box. Each square has exactly 3 units." <-- do you mean each square is a MEMBER of exactly 3 units.
356
I feel like I need to say a public thank you to the mods who have been working hard to keep the forum spam free. Especially Deozaan lately.
This work is almost completely unseen by everyone, because it happens behind the scenes, but I can see from the moderation logs that every day, multiple times per day, tirelessly, the spammers are being removed before they are ever seen.
On behalf of everyone here, thank you!

 :Thmbsup: :Thmbsup: :Thmbsup:
357
yeah i mean if you already have psvr im not sure it makes sense to buy an oculus -- the games and experiences are going to be much smaller and lower powered
and ironically, MORE expensive than their full version brothers on pc and ps4.
358
here are some downsides to it:

1. Battery for the headset does not last very long, can be annoying; 3rd party battery pack is one solution.
2. Included head strap not very good; 3rd party replacement is solution
3. Games are SHORT and EXPENSIVE.
359
Dammit... are you guys going to make me get one? The one thing with the PS4 one is that I'm really the only one that can set it up. Looking at this, it seems a lot simpler.

One of the things that convinced me to pull the trigger on the occulus is how its described as reaching new levels of usability.   "It just works" is how it was described to me, and I have found that to be true.  And the fact that it's entirely portable and needs no beacons set up and doesnt need a cable attached to a pc, just makes it very easy to use.
360
Find And Run Robot / Re: FARR not showing up when monitors were disconnected
« Last post by mouser on July 23, 2021, 09:20 AM »
Let me know if it doesn't work.
361
Find And Run Robot / Re: FARR not showing up when monitors were disconnected
« Last post by mouser on July 23, 2021, 08:11 AM »
Can you make to center only if it is completely outside of visible area? Basically I like it to be visible on the last place I moved it unless it's really not even visible because it's on a non existing screen!

I *THINK* the latest beta does that if you have that box unchecked.
362
Find And Run Robot / Re: FARR not showing up when monitors were disconnected
« Last post by mouser on July 23, 2021, 05:28 AM »
There is an option in FARR to have it always pop up on the active monitor:
Screenshot - 7_23_2021 , 5_25_51 AM.png

However I have a faint memory that it was buggy in the last official version and that I fixed the bug in the latest beta here:
https://www.donation...ex.php?topic=10505.0

If you think that option might help you try installing that beta version and let me know if it works for you.

-jesse
363
The flexibility and ease of use of the Oculus is in a league of it's own -- I don't think people will realize how much of a burden it is to have to use a headset connected by a wire to your pc.
The nice thing about the Oculus, and future iterations, is that it has the OPTION to be connected to the pc to play some of these higher end games (through SteamVR), while still having the option to play games made for it portably.
So while Half-life Alyx cannot be played in the Oculus portably because it's requires too much computation, it CAN be played if you tether the headset to your pc.  So in that sense it's the best of both worlds.
364
Living Room / Re: Funny Animal Videos
« Last post by mouser on July 12, 2021, 07:25 AM »
Another one of those videos of people making music from animal sounds:
365
yes.
366
You do need a facebook account (yuck), but you could just create one solely for this purpose.

anandcoral - It's not really doing AR (Augmented Reality), so it's not about showing you the real world with stuff added.

There are features for broadcasting what you see to a tablet for others to watch or record.
367
So I bought an Oculus Quest 2 VR headset ($300 amazon).

Screenshot - 7_11_2021 , 4_09_26 AM_thumb002.png

I was just blown away by the experience.  Both the quality of the experience inside the VR world, and also how painless the whole process is.
It's a standalone device, no need for cables to a computer (essentially powered by a phone-grade android cpu).

I have not been keeping up with the progress in VR technology.  I'm still in shock how cool the experience is.  I think we are going to see mass adoption of this stuff in the coming years.  As someone who is not really a video gamer and is mostly a board gamer, I really do think this is all going to change with VR.  Very cool stuff.

https://www.oculus.c...m/experiences/quest/



(I've decided to try some tinkering with coding for it using Unity).
368
It looks beautiful.  These 3d engines always seem like such massive projects, I never know how to judge them.
It's especially weird because when I look at an engine I'm not as much interested in it's capabilities as much as I am in its longevity and support, as I don't want to use something that isn't strongly maintained and developed.

I've just started to play with Unity myself as I've gotten very curious about developing for Oculus/VR platforms.
369
Living Room / Re: My new project is now live: Co-op For Two on YouTube
« Last post by mouser on July 09, 2021, 03:50 AM »
Awww thank you guys for such sweet encouragement and kind words.  It's been a HUGE learning experience.
370
Flash Games and 2XL Simulator / Re: Rewriting 2xl simulator in html5
« Last post by mouser on July 04, 2021, 11:03 PM »
Python is a great language -- it's wonderful to hear you are enjoying the project.  Can't wait to read more updates.  Keep at it!  :Thmbsup: :Thmbsup: :Thmbsup:
371
Gizmo's Freeware (Tech Support Alert) website put up a blog post today announcing they are shutting down.

https://www.techsupp...ime-say-farewell.htm

Screenshot - 7_3_2021 , 10_16_04 PM.png



I've told this story before, but when I put up the DonationCoder website 16 years ago to ask for donations for a couple of programs I had written, Gizmo's was one of the 2 or 3 websites that were just immediately supportive and friendly, and the community around gizmo's was so encouraging of the idea.

Ian Richards (Gizmo) was always super supportive and friendly and encouraging of independent freeware developers, and gizmo's site has remained *THE* site to send people for recommendations of what freeware to use.

If Gizmo's is really shuttering up shop it will be a major loss to the freeware community, and the site will be sorely missed.
372
Living Room / Re: My new project is now live: Co-op For Two on YouTube
« Last post by mouser on June 28, 2021, 01:12 PM »
Livestream in less than 6 hours.
373
General Software Discussion / Re: Windows 11 Announced
« Last post by mouser on June 24, 2021, 06:19 PM »
blech, i prefer square sharp edges and no transparency  :down:
374
Living Room / Re: My new project is now live: Co-op For Two on YouTube
« Last post by mouser on June 23, 2021, 01:02 PM »
Just a heads up that we will be doing a livestream channel update and Q+A episode on June 28th (@ 8pm EST):

https://www.youtube..../watch?v=U8Es_B1wBMA

Would love to have some of you stop by and say hello!
375
UrlSnooper / Re: I'm guessing this project has been abandoned?
« Last post by mouser on June 21, 2021, 10:43 AM »
I think npcap might be the way to go.
Pages: prev1 ... 10 11 12 13 14 [15] 16 17 18 19 20 ... 1514next