Thanks to visit codestin.com
Credit goes to shewhoshapes.wordpress.com

Skip navigation

That quick optimization I wrote about a couple of days ago saves 15% of the time needed to solve 88. That’s a great board for testing. Not so large that it never finishes, not so short that I can’t easily tell what optimizations are working.

15% is pretty darn good for one line…

if flips == 0 and board.brdarr[M+P.parr[0]] == 0: continue

That’s going to make a huge difference when I rewrite this in Pyrex.

85 didn’t complete while I was at work. Two tries later once I got home, I found one that did. Shifter solved it in 1486 seconds.

86 literally completed in the time it took to hit enter (Shifter runs from the Linux command line, another barrier toward handing my code to anyone else). 0.09 seconds, it claims.

87 done in 0.84 seconds. This must be the easy bit of which I was told.

88 is taking longer. 6 flips. These puzzles are wildly inconsistent.

Since I believe Shifter will be able to solve this in a reasonable amount of time, I’m solving it both on my relatively slow Linux machine and my faster Windows laptop. Linux just solved it in 134 seconds, waiting on Windows now (I didn’t start them at the same time). Hmmm… I expected it to be done by now. There it is — 177 seconds. That’s entirely unexpected.

Max neopoints! Woot!

See ya tomorrow!

Almost time to start talking to people about when to take 100. Assuming the puzzles don’t get suddenly harder, I should be sitting at 99 in a week.

85 is proving to be tough. I had the computer working all night on it, and nothing. I got what I thought to be an even simpler puzzle, one with just 11 flips and no small pieces, but the 3-depth level is being just as intractable as they always seem to be. Few of the pieces are all that large either, which might be part of the problem.

Looks like my steady march toward 100 may hit a swamp.

Larvemoth is poised at level 99, waiting for April to claim 100, so probably it would be rude of me to try and get it then anyway. Well, once I get to 99, I guess I’ll work it out with whomever is there around then. Larvemoth has had the top spot many times, after all.

I put in that quick optimization, but ran it on my slow computer because I was playing EQ2 on my fast one. Shifter solved 84 in 5526 seconds. The one I set running in the morning hadn’t completed by the time I got home, so I got a new one. 14 flips.

I have a bit in my solver where I start applying a transform matrix to apply the piece to the board, then back off if doing so causes a flip and there are no flips left. I could do a little precheck that just says, if there are no flips left and the very first cell of the piece would cause a flip, just move on, without going through the overhead of starting the process and then backing off. This should more quickly bring pieces to the place they need to be in the special case where all the flipped cells have been flipped.

I’ll have to try that, especially if Shifter hasn’t solved level 84 by the time I get home.

While filling in the solution to level 83 (in which I had taken special care to make sure there were no single cell pieces) (I don’t have time this morning to do the piece-move sorting thing), I noticed that it is not uncommon for pieces to flip cells that were solved on the new board. So I don’t know how much time sorting the piece moves will save. Since it’s frontloaded time — done before the solver starts — it probably doesn’t hurt anything.

Level 84 is 12 flips, and the smallest piece is two cells long and I have to go to work.

Ya know, I never saw a solved cell flip TWICE. But I can’t afford to analyze moves or do any sorting in the inner loop. Earlier versions of shifter tried stuff like that and it only led to tears.

Currently working on Level 83, and it isn’t going swiftly, even though I have a low flip (12 flip) board.

One thing I was thinking of last night is the concept of “solved” cells — cells you don’t expect will ever change again. For instance, a cell that starts out in the solved state, and is then flipped and several more pieces must be placed over it in order to return it to the solved state. After that, how unlikely would it be that it would be flipped AGAIN and have to be solved all over again? Perhaps more likely in the middle of the puzzle, but even then… I bet there’s a point at which you could say, a piece that covers a cell that has already been flipped once is less likely to lead to a correct solution than one that is not covering any flipped pieces?

Since flips can never increase in a solution, it could be that the algorithm I use already implicitly takes this into account. But looking at the puzzles I am getting now, the pieces rarely ever cover a solved portion of the board.

So maybe if I just sort the piece move permutations (an array of all possible piece moves, calculated in advance so I don’t have to spend time doing it in the inner loop) by the number of unsolved squares they cover… that would be better…

Gonna give it a shot. Level 83 looks like it’ll need to run while I am at work anyway.

11 flips, completed in 23 seconds, took me about five tries to get a good board.

There’s a very similar puzzle at http://www.hacker.org/modulo/

And you are expected to use computers for it, unlike Shapeshifter, which seems to enjoy the fiction that every player is solving this by hand, even though that becomes impossible fairly quickly.

Seems Sun is hiring Python developers to port Jython (Java-Python) to their Java Virtual Machine, so that Python and Java can intermingle.

Looks like the world is conspiring to make my Python programming skills even more valuable. Which is good for me, as I FAR prefer developing in Python to developing in Java.

http://blog.internetnews.com/apatrizio/2008/03/sun-is-continuing-its-acquisit.html

While looking for information about Jython, I heard about Cython, which is a similar language that converts Python programs to native ‘C’ programs, including additional data types corresponding directly to ‘C’ data types. I think I might try Cython to start, then use Jython to get the multiprocessing down. Separate development efforts.

Design a site like this with WordPress.com
Get started