Unvanquished esoteric programming

Discuss whatever you'd like!
Post Reply
User avatar
killing time
Programmer
Posts: 164
Joined: Wed Jul 04, 2012 7:55 am UTC

Unvanquished esoteric programming

Post by killing time »

Recently pondering the collection of curious console commands which have been implemented in our beloved game beginning with the heritage of Tremfusion, I came to the insight that they make an amusing esoteric programming language. The functionality is enough to be Turing-complete, but sufficiently small that it is not excessively easy to write a general program in. :cool: Compared to the most famous Turing tarpit, Brainfuck, Unvanquished has a much more humoristical set of primitives: rather than the humdrum subtraction of 1, or advance of the memory pointer, there are things like command scheduling and execution of strings.

In this vein, here is a line which defines a utility for sorting natural numbers in Unvanquished:

Code: Select all

alias sort "alias sort..._sort \"sort...foo \\\$sort...bar\\\$ -1; if \\\$sort...foo\\\$ > -1 \\\"/delay \\\$sort...foo\\\$01 echo \\\$sort...foo\\\$;alias sort...\\\$sort...foo\\\$ set sort...bar;sort...\\\$sort...bar\\\$;unalias sort...\\\$sort...foo\\\$;sort..._sort\\\" \\\"unalias sort..._sort\\\"\";set sort...foo;delay 8 sort..._sort;set sort...bar"

It should be used with a space-separated list of nonnegative integers like thus:

Code: Select all

/sort 12 16 14 23 15 4 7 9 0 13 11

Please share your own in-game script creations :granger: :firebomb: :thumbup: !

User avatar
Ishq
Project Head
Posts: 1147
Joined: Tue Mar 06, 2012 8:32 pm UTC

Re: Unvanquished esoteric programming

Post by Ishq »

Wow...This is actually quite impressive, although it looks like a sleep sort

Post Reply