I made a program to test the hypothesis set out by today's xkcd, specifically that:
Quote:
... if you take any article, click on the first link in the article text not in parentheses or italics, and then repeat, you will eventually end up at "Philosophy".

Most people who have tried this at this point know that there are some cycles and such, but it's fun to watch it go, and I'd like to start collecting statistics about how many loops and stuff. My friend made this prediction:
Quote:
80% of all articles will have a finite number of hops, median number of hops (among those articles with a finite number) will be about 18, max (finite) number of hops will be about 200.

Here's a screenshot of it going:

If anyone wants to try it (and has a Windows computer or Mono installed on their Max/Linux computer) you can get it at:
http://merthsoft.com/WikiPhilosophy.zip
It uses .net 2.0.
If you just run it straight it starts from a random page, if you give it a command line parameter it will use that url (it can be anything, even not from wikipedia, but that'll go bad really quickly).
There are some kinks, and so sometimes it just gives up what it's trying, but it does detect loops. It doesn't currently collect and stats other than the the number of hops. I'll improve that later.
Once it gets to philosophy or finds a loop, it waits until you hit a key and then grabs another random page and tries it again.
Considering the success of Tari's XKCD thing, I figured I might as well Digg this project, cool as it is. Check it and digg it:

http://digg.com/news/technology/wikipedia_philosophy_hops_program_from_xkcd
Here's hoping my server doesn't crash!
http://en.wikipedia.org/wiki/Wikipedia:Get_to_Philosophy

Also, save yourself time, and build a graph. That way you can terminate searches when you reach a known chain.

[edit]
Digg you say? I hadn't even logged into version 4 until today.
That's not saving me time, that's saving you time Wink
But that is planned, I just wanted to make something really quick.

Errors reported from facebook:
Quote:
Something is wrong with the counter if it says "Giving up" and starts a new thing, I think the stuff before it gives up might also be counted as a step in the count for the next thing.
It also doesn't reset the name of the starting page correctly after it gives up, and it now counts correctly but still displays all of the pages from before it gives up when it lists the numbers at the end.

And to my knowledge these are fixed now, same place:
http://merthsoft.com/WikiPhilosophy.zip
Huzzah! You guys should keep digging Shaun's project, or if you guys know how to make Reddit work, go for it. Wink
Necropost but this is from a discussion on #omnimaga.
The bot currently crashes and burns on Windows. Any reason for this?
Define "crashes and burns", by which I mean "error logs, please".
My guess is they've changed their html so the way I'm scraping the page doesn't work.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement