Turing completeness II

Well, as I wrote in the previous post, sed is a Turing complete language. We can use it to implement some simple algorithms, or even a dc interpreter. But what does it really mean? How complex tasks may we achieve using plain sed?What about writin…Well, as I wrote in the previous post, sed is a Turing complete language. We can use it to implement some simple algorithms, or even a dc interpreter. But what does it really mean? How complex tasks may we achieve using plain sed?What about writin…

Well, as I wrote in

the previous post, sed is a Turing complete language. We can use it to implement some simple algorithms, or even a dc interpreter. But what does it really mean? How complex tasks may we achieve using plain sed? What about writing some game? While browsing web, I came across a classic Tetris game written in pure sed. Save this file to something like tetris.sed. Depending on your system, you may need to adjust shebang. For example if you are using PLD Linux, change “#!/usr/bin/sed” to “#!/bin/sed”. chmod a+x it, and run it. Unfortunately main loop is controlled by input lines, so you need to press ENTER few times to allow things to happen. It seems to be the strong limitation of sed. Don’t you think it is awesome? In case you can not get it work (or you just don’t trust any piece of code that people publish on the web), there is an amazing video of tetris.sed in action: Since there is no way to display any graphics in pure sed, we are limited to rogue-like games. Now I’m waiting for ADOM being rewritten in sed!

You May Also Like

Scrum w Polsce – TouK

Nasi koledzy z Fluidcircle opublikowali właśnie studium przypadku opisujące doświadczenia TouK z wykorzystania metodyki Scrum. Wszystko w ramach programu “Scrum…

SortedSet + Joda DateTime == danger

It's been quite a long time since I wrote something on this blog... Two things occurred that made me do this. Firstly, I'm going to talk at Java Developer's Conference in Cairo and at Booster conference in Bergen next month, so I want to have some co...

Open IMS Core Mr interface

Open IMS Core does’t have standard way to define connection to MRF (Media Resource Function) on Mr interface.In IMS Mr interface is based on SIP and is similar to ISC used by Application Server (AS). Because of that we can define MRF as IMS AS and just add Wildcard PSI that has trigger on that AS. That [...]