Menu

Miscellaneous

This page presents some useless programs I wrote. You can play with them and modify them, but please tell if you find bugs.

Sed

Sed is not a simple stream editor. It can be really powerful.

Sedermind Description: My Mastermind implementation in sed. The code to guess is generated from a user input.
Download: sedermind.sed. Please use GNU sed (and extended regexp).
Usage: sed -rf sedermind.sed
A puzzle Download: puzzle.sed. Please use GNU sed.
Rules: puzzle.txt (should be in the same directory as the game)
Usage: sed -f game.sed
Palindrome Description: for each input line, the script prints "yes" if line is a palindrome, else "no".
Download: palindrome.sed
Usage: ./palindrome.sed
A pathfinding Description: a simple sed tool which computes the shortest path in a maze. Edit the script file to use another maze. Then execute it to see the path from A to B (in some extremely rare cases, it might fail).
Download: path.sed
Usage: echo '' | sed -f path.sed
Output example: path.out
Connect4 Description: the famous game, for 2 players (there's no AI!). Try to connect 4 'X' or 'O' in a line. Works fine with GNU sed version 4.1.2. You may have some problems with non-GNU versions.
Download: connect4.sed
Usage: ./connect4.sed and press enter
Preview: connect4.out (color has been removed for preview)

99 bottles of beer

The aim is to write a program that prints the song. See 99 Bottles of beer web site for more details.
I wrote these two versions:

Gnu BC version (uses GNU extensions of bc) Download: bottles.bc
Usage: bc bottles.bc
Tiger version Download: bottles.tig
Language information: Tiger is a language described by Andrew Appel in his books (Modern Compiler Implementation). As far as I know, there is no free version of the compiler, but you can find details on this page: http://tiger.lrde.epita.fr.

Other

Prime numbers Description: Can you recognize prime numbers? Not easy.
Try it: online game.
Learn PI Description: It's a very simple script to learn pi decimals (requires Bash).
Download: learn_pi.sh.