Friday, July 23, 2010

Quasi-Final version of Sudoku Solver

This is going to be the last update to my sudoku solver for a while.



So here's the rundown:

1) I changed the way the dialog to set values works. To reset a box to null, press the button for the current value again. The GUI will not let you set a box to an illegal value.

2) Guessing works. Boxes solved without guessing are filled blue. If it can't finish the puzzle, the solver will ask if it can start guessing. The boxes set after guessing are filled red.

3) Trying to guess on a sudoku without a unique solution will cause the solver to enter an infinite loop.  Refresh the browser to end.

4) Added a reset button.

I may add advanced techniques later, to get it to solve further before needing to guess, but I'm kind of losing interest now, so we'll see.

Later,

Thursday, July 22, 2010

Blog stuff

I don't think the hide-post-thingy I have been using likes blogger's latest revisions.  But blogger added their own jump break stuff, so I changed over to that.  I really liked the one I had been using, though.

Later,

Thursday, July 08, 2010

Sudoku Solver

I think I've learned enough Java to try to write a Sudoku solving applet.

The first step in running the solver will be setting the board. Click on a box to set it's value (right now, each click increments the value, later I might use a dialog to pick the value, but this is good enough for now)

UPDATE: I added a dialog to set a box value.

UPDATE2: It was a hell of a fight, but I managed to get the GUI to look pretty much how I want. I ended up having to draw the heavy dividing lines manually, so they don't quite re-size right.

UPDATE 3: Added functionality.

UPDATE 4: Changed the look a bit. The boxes now change color when manually set. Adding the advanced techniques is tougher than I thought. I may take some time. After hitting the "Solve" button, the dialog function changes. Instead of setting the box value, it allows you to change the restricted values (blue means value is restricted).

this is just the GUI. the "Solve" button does nothing yet.
The applet goes as far as it can with the very basic algorithm it uses.
It successfully solved the NYT Easy and Medium Sudokus for July 15, 2010.
It wasn't able to completely solve the Difficult one, but I have ideas for more advanced techniques to add, so it shouldn't be long. YAY!!!

Note: it doesn't error check (yet). If you enter an impossible sudoku, it will still try to solve it.

*** Removed. See post dated 7/23/2010 for sudoku solver applet. ***

"I am so smart! S-M-R-T... I mean S-M-A-R-T!"
</Homer>

Praise me! PRAISE ME!
</GIR>

Later,

Some sidebar clean-up

Several bloggers at ScienceBlogs have left due to the kerfluffle about the PepsiCo blog (Which I really don't get, especially since the PepsiCo blog is gone now anyway. But it's their decision, and I'm cool with that.)

Some of those that left I read regularly. I have updated the links to the ones that I still follow, and have taken the opportunity to remove the ones I really don't anymore.

Later,

Wednesday, July 07, 2010

Thoughts on why you can't logically disprove god to a theist.

Consider this:

given some real, non-zero value, a

        a = b
a*b = b2
a*b-a2 = b2-a2
a*(b-a) = (b-a)*(b+a)
a = b+a

This is obviously wrong. You don't even need to understand the algebra to see that it's wrong. If a is not zero, and a equals b, then a cannot equal a+b. The argument is nonsense. Identity is not a conclusion. It is an axiom. It is foundational to mathematics.

As far as theists are concerned, the same thing applies to their god. If your logic leads to the conclusion that their god doesn't exist, then, to theists, there is obviously something wrong with your logic; even if they can't say what that is, exactly. For them, their god is an axiom, foundational to reality. Only when a theist is able to reject that premise as false can they be reasoned with.

That is why I stick to "Evidence or STFU" when someone challenges my atheism.

Later,

Sunday, July 04, 2010

Fun stuff!

I'm teaching myself Java.

Check out my first applet:

Cool huh?

Later,

Saturday, July 03, 2010

Facebook

I've had a Facebook account for a few months, but have decided to deactivate it. I have a phone. I have an email account. I have a blog. I have relatives who know all this information. If anyone wants to get ahold of me, it isn't difficult.

Two people who might read this could point out that I participated heavily in a fairly long discussion thread just recently. That was pretty cool, but also an exception.

There's nothing actually wrong with Facebook, I just wasn't feeling it.

Later,

PS238

The other day I discovered an awesomely cool webcomic. PS238. (This link goes to the first page, the sidebar link goes to the current page)

It's about an elementary school for "metaprodigies". That is, kids with superpowers.

This is my favorite quote so far:

"Why Tuesday?"
"Most cosmic events happen on Tuesdays."

Check it out.

Later,

I have discovered tact.

Facebook. Where people I have never met can be my friend.

One of these friends posted the following:

Every blade of grass has its angel that bends over it and whispers, "Grow, grow."The Talmud

My first thought was "How do they avoid getting chopped up by lawnmowers?"

I did manage to force myself not to post that question in reply. I had to post it here to relieve the pressure, though.

Later,