Friday, August 15, 2008

Fantastic Contraption

I really like my blog to have pictures and/or video with the text, 'cause quite frankly pot (plain ole text) has to be pretty interesting if I'm going to read it. Too bad I can't have any pictures or videos with my post this week, but it would kind of spoil the whole subject. Now for the good stuff...

I spent most of my free time yesterday playing a game called Fantastic Contraption. The game is very simple, use five types of items (clockwise wheel, counter-clockwise wheel, neutral wheel, fluid rod, and solid rod) to make a fantastic contraption that will move an object from the start area to the goal area. Sounds simple right, trust me, it's not. What I love about this game is that the physics are pretty much spot on which is good because that's what the whole game is based on. It's really great because every control works just as you think it would (BTW save yourself some time and use the shift key when resizing and moving instead of clicking the resize button).

When you make a contraption that successfully completes a level you can save it and share it with your friends. I've saved some of mine which you can see links to at the bottom of this post. Once you get the hang of it I think it would be fun to have a challenge and see who could come up with the simplest solution to each level. Anybody up for it? Discuss it in the comments and see if we can come up with some rules for what the simplest design is. Maybe see who could get the prize in the goal quickest, who knows? Write in the comments and let me know what you think.

Here are my submissions for
Level 1, Level 2, Level 3, Level 4, Level 5, Level 6, Level 7, Level 8, Level 9, Level 10, Level 11, Level 12, Level 13, Level 14

Wednesday, August 6, 2008

Brain Den

So, you're at work and bored in front of the computer (duh! Why else would you be reading this?). Brainden.com is a place that I often wind up when I'm in this position. Please don't go there now, finish reading this post. Most of the time I just try to solve the puzzles in my head because people have already posted an answer. The thread that you see below was first solved by yours truly and the first puzzle that I solved first, btw. See what you can do with the puzzle before moving on to the website. I'll post the answer and the link to the post later (I want you to figure out the answer on your own). So here it is:

Most of today was spent in meetings with the PHB*, explaining why our project is behind schedule.

A quick virtual summary (what I imagine was said, rather than what was actually said): So anyway, it was a relief to get back to programming. As I dug into a bitmap edge detection algorithm, I ran into a spot where I needed to check the eight pixels surrounding the current one, in clockwise order, given any starting position. I whipped out a quick conditional statement that tested for each of eight possibilities, which works fine, but is ugly. Since it worked ok, I couldn't justify a lot of time to optimize it, so I gave myself five minutes to see if I could come up with a slicker way to do it. I didn't, so I moved on, but now it's 11PM and I just thought of another way to do it, and I figured it might be fun to see if anyone can find an even simpler solution.

So here's the problem ...

Consider the following diagram:



Find a single function f(x,y) that, given any one set of the eight coordinates, returns the coordinates of the adjacent square, moving clockwise. You may use any mathematical operands, including rounding, absolute value, trig functions, etc., but no conditionals.

*Pointy Haired Boss