Well, it’s about time for there to be another Lulz of the Day! Today we’ll be lulzing about Ark, my IRC anti-floodbot script. As an IRCop on a network, I am constantly figthing floodbots who join, /msg everyone on the network some spam and then disconnect. I figured that there must be a way to stop them, and so I diligently started working on Ark. Ark is a perlscript that connects to an IRC server as an IRCop and joins the most popular channels (which you specify). It then waits quietly, bidding its time until it gets /msg’d. Once it receives a message, it springs into action, checking the received message against a list of regexs. If any of them match, it will /kill the bot and resume its slumber.
This very simple, yet oddly helpful script can be downloaded from my code site
Peace and chow,
While cleaning up my hard drive, I’ve come across many old projects that are pretty interesting, and I thought I’d start a mini-series of these little pearls (perls?) I come across as I find them. Without further ado, lets start with our first Lulz of the Day (LOTD)!
As many of you know, I’m in the systems biology class this semester, and recently we spent a week or so looking at the genetic algorithm and its applications. I immediately began hacking on a genetic algorithm to ‘breed’ a Corewars warrior. The code for this is pretty simple, and still needs much revision, but it’s bred some programs that are pretty good. I’m going to run it a few times and try to put together some statistics in the next few days, but for now, you can download the source and play around with it as you wish. Basically what it does is:
- Generates some initial warriors with random commands and arguments
- Pits the warriors against themselves in battle using the corewars-cmd command
- Ranks them by their scores
- Cross breeds the best 20% of the population, and mutate the rest (with 5% chance of mutation)
- Repeat from step 2 for the number of generations.
- Modify the cross-breeding algorithm so it doesn’t just append one program to the other, but mixes up the commands of both
- Small bug fixes with the scraper for the corewars-cmd results
- Run a number of times, and then pit the best generated warriors against some made by humans
Peace and lulz,