[ Home : Programs | libCVD | Hardware hacks | Publications | Teaching | TooN | Research ]

Sed

Sedoku

This program solves Sudoku puzzles using sed. Puzzles are entered in the following form on the standard input:
..59.43..
4.87.....
.1..8....
2..63..5.
.5.....3.
.8..41..6
....7..2.
.....56.7
..12.34..
with a dot representing an unsolved square, and the result coming out of the standard output. The algorithm works as follows: The sed required to implement this algorithm is explained in the sedoku [incomplete] program.
Download: sedoku.sed

99 Green Bottles

You know the song 10 green bottles, and the 99 bottle version commonly song on very long school coach journey's (much to the chagrin of the driver)?

  99 Green bottles hanging on the wall
  99 Green bottles hanging on the wall
  And if one green bottle should accidentally fall...
  98 Green bottles hanging on the wall
  

...and so on.

Well, here is a sed program which will print it out, using either numbers or the names of numbers.

BrainF*@!

I did this to see if sed was Turing complete. BrainF!@k is a minimalist structured language, and it happens to be Turing complete. So if sed can interpret BF programs, then it too must be Turing complete. And it is. The interpreter can only cope with a maximum of 255 loops in the program (it could be adapted to do more, but probably won't be).
Download: brainf__k.sed

Links

If you're interested in sed, I can recommend the following sites:

If you're interested in advanced sed hackery, then the most impressive programs are:

Updated July 14th 2011, 10:52


Home : Programs | libCVD | Hardware hacks | Publications | Teaching | TooN | Research
* Programs : EPS to ARTK | Autoconf tutorial | Awk | Numerical Disasters in C | Floating point templates in C++ | Gnokiifs | Parallel | PostScript | Sed Hacking | X11 programs


ed (at) edwardrosten . com
Check HTML compliance