Page 1 of 1

Unvanquished esoteric programming

Posted: Fri Feb 06, 2015 9:09 am UTC
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: !

Re: Unvanquished esoteric programming

Posted: Sat Feb 07, 2015 10:16 am UTC
by Ishq
Wow...This is actually quite impressive, although it looks like a sleep sort