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

Sygnalizacyjne ABC

Poniższy artykuł oparty jest na wspaniałej pozycji książkowej “System Sygnalizacji nr 7 G. Danielewicz, W.Kabaciński”. Gorąco zachęcam do…

Cross-platform mobile apps – possible or not?

What is Titanium and how it works. Titanium is an open-source solution for cross-platform, almost-native mobile app development. It has its own MVC, JavaScript and XML-based framework Alloy. Titanium is based on assumption, that each app can be divided into two parts: UI, which is platform-specific part and application core – business logic, common to all […]What is Titanium and how it works. Titanium is an open-source solution for cross-platform, almost-native mobile app development. It has its own MVC, JavaScript and XML-based framework Alloy. Titanium is based on assumption, that each app can be divided into two parts: UI, which is platform-specific part and application core – business logic, common to all […]