You are currently browsing the category archive for the 'computers/software' category.

In a previous post, I discussed my attempt to write a program to solve a puzzle. I never updated that post because, well, I ran the program all night and it didn’t find the solution!

I had made up a fake puzzle that I knew had a solution for testing, and the program could solve it in 15 minutes. But it couldn’t solve the one I had recorded for the real puzzle. I figured (and hoped) that I had simply recorded it wrong and to check, I re-recorded the pieces and tried again. And it worked! Here’s how:

Read the rest of this entry »

My mother gave the fam a new game for Xmas called “The Impossible Puzzle.” Or maybe that was the company name. Either way, the label is certainly apt.

The puzzle is composed of nine, 4-sided pieces with interlocking parts in the shapes of the 4 card suits (hearts, diamonds, etc). There is only one way to lock the 9 pieces into a 3X3 square, and the game touts the fact that “there are over 300,000 combinations, only one of which is correct.”

Fig.1: An example of the puzzle pieces.

My mother, her bf, and myself all fiddled with this puzzle for a while before becoming too frustrated. There seemed to be no way to logically sort through the options of all possible arrangements and rotations of the pieces and clearly a brute-force method of trying all combinations would take way too long by hand. But maybe not for a computer. So, I figured this would be an excellent opportunity to try out my programming skills.

Read the rest of this entry »

I updated the Weasel program a fair bit, and it is now available on sourceforge. The program still does the same stuff, but the interface is cleaner and friendlier. Most of the changes were just to make the code easier to navigate.

BUT, I am currently working on a more interesting program that will model a population instead of a single line of descent. The idea would be that there are creatures defined by the user that are competing with one another for food. They will have multiple user-defined traits that effect how much they eat, how many offspring they have, etc. You would choose how many generations you want it to run (since now there is no pre-defined endpoint), how much food is available in the environment, and then you could check some statistical info to see how the population changes over time. Or maybe it would would just print data so that you could pop it into Excel and I won’t have to try to write statistics code.

A lot of cool stuff could be done with this, and complicated things could be interestingly (not accurately) modeled by adding things like diseases, disease resistance, environmental effects/catastrophes, predators, and so on. I’m going to keep it simple until I figure out how to program a Windows graphic user interface (so you could have menus, mouse interaction, pretty graphs, etc), but if any of the few people who read this have ideas or are interested in contributing, please let me know.

This post discusses a computer program that you can download to try yourself (and get the source code if you want to make your own version).

At our huge family reunion (Mom’s side) earlier this summer, we were handed a wordfind that someone had generated somewhere on the Internets that contained the names of the family founders. I was solving mine and noticed that, as anyone has frequently observed, in any given wordfind you will find words that are not in the list. Presumably, this is due to the randomly-assorted letters, by chance, spelling out an unplanned word. Of course, the wordfind makers might also stick those in on purpose (for example, the family wordfind contained the website name multiple times) or purposely prevent some random words (profanity). Regardless, I began to wonder how often a word might appear in a word find just by chance. So I used the margins to scratch out a formula for the chance of finding a word of a certain length within a matrix of random letters.

Read the rest of this entry »

(re-posted from coster3.com, the joint blog I share with my brothers)

Inspired by Dawkins’ METHINKS IT IS LIKE A WEASEL program (hereafter just weasel) described in his book “The Blind Watchmaker,” and wanting to practice my blossoming C++ skills, I decided to write my own version of weasel. It was successful enough, and I found the results interesting enough to warrant discussion. Download the program (Windows .exe file) so you can try it out for yourself (and you can also get the source code if you want). In this post I’ll discuss what the program does and why. In the next post I’ll talk a bit about the results of the program.

weasel_title

Read the rest of this entry »

[UPDATE: I fixed a bug that reduced the average mutations by 1 and I also made it so that you can rerun the same scenario or change the settings before a run.]

I’ve finished the beta version of my METHINKS IT IS LIKE A WEASEL program. I want to tweak it to make it a little more visually pleasing and to add some options for more data retrieval. Or even an ascii graph!

Anyway, I’m posting the code and an executable. If you make any interesting changes (I’m keeping it open source, of course) please let me know. Otherwise, I’m happy to take suggestions.

Windows executable file.

c++ source code.

it is like a weasel.

Apparently this is a line from Shakespeare. I don’t like Shakespeare (I appreciate it, but I don’t like it). This line came up because Dawkins used it, years ago in one of his books, to demonstrate the superiority of selection vs. randomness. He had written a simple program that would start with a random set of letters, make mutated “offspring”, and then select the one most like the target phrase “METHINKS IT IS LIKE A WEASEL.” After tens of generations, you get the target phrase.

Read the rest of this entry »

Like a baby. And not just any baby. These games make me cry as if I am a baby whose teddy bear was taken out of one hand and shredded by an evil clown and whose candy was taken out of the other. And then the baby was punched in the face. After being flicked in the eyes.

Read the rest of this entry »

Normally, you can use url forwarding to make it so that when someone types in a website address or clicks a link, that person will end up at a different website instead (try it; going to adamcoster.net will take you to adamcoster.com). Since I am moving to this blog, I am trying to make it so that visiters to adamcoster.com end up at coster3.com instead. For some reason it isn’t working… Read on if you are interested in using url forwarding. [Edit: It is now working!]

Read the rest of this entry »

And joining forces with my two younger brothers. Brother Stoz thought that we should start a multi-author site, since the three of us write similarly (although on different topics). There are a lot of good reasons to do so, so I have copied over all of my posts to

http://coster3.com

where my brothers have already put up all of their posts. I will no longer be updating this site, and will eventually turn it into a more professional personal page, but, for the time being, I will leave all of the original posts here. So, please change your bookmark or feed reader to coster3.com, where you can enjoy material written by the three of us.