A whole lotta weasels
A joint effort to write the Dawkins' Weasel algorithm in as many languages as possible, using the language's specific idioms.
Algorithm described here.
- Each implementation should only be one file and placed in the root folder.
- Each file should be named by the language in which it was written.
- The program should print the fittest string of each generation, as well as the number of generations it took.
- Mutation rate should be 4%, generation size 100.
Each implementation should, as far as it is feasable, capture the charachteristics of that language. The goal is readable and enjoyable implementations in as many languages as possible.
- Fork this repository
- Write your Weasel in the desired language.
- Name the file after the language, add "-number" to the end if an implementation already exists.
- Add instructions on how to run the code, including instructions on how to install dependencies in the README.md file. You can assume that the users have Homebrew or Chocolatey
- Creata a pull request
Building the examples:
Below are the basic instructions to run the code examples.
brew install python
choco install python
apt-get install go go run go.go
apt-get install gdc gdc d.d ./a.out
first install mono:
apt-get install mono
clone the github repo and follow the instructions there (make && make install)
fsharpc fsharp.fs mono fsharp.exe
apt-get install sbcl
sbcl --script common-lisp.lisp
install node via apt-get
install coffee-script via npm
1. Compile Nimrod from the github sources 2. run: nimrod -r nimrod.nim
Visual Basic 6
- Start Visual Basic 6
- Select "Standard EXE" from the new projects dialog
- Add "visual-basic-6.mod" to the project ("Add Module")
- Double click on the form to enter
Call WeaselProgramin the event
- Hit F5 to run
Since VB6 is the base for VBScript, the VB6 weasel can easily be converted to VBScipt. For example to run in Excel, create a new macro and replace
Range("A" & excel_row).Value =, where
excel_row is an incrementing variable for keeping track of the current row.