Page namespace (page_namespace) | 0 |
Page title (without namespace) (page_title) | 'TheLang' |
Full page title (page_prefixedtitle) | 'TheLang' |
Old content model (old_content_model) | '' |
New content model (new_content_model) | 'wikitext' |
Old page wikitext, before the edit (old_wikitext) | '' |
New page wikitext, after the edit (new_wikitext) | '== TheLang ==
TheLang is an esoteric programming language by [[User:Tema5002|tema5002]] derived from [[Brainfuck]]. It's primary interpreter is written in C.
== How It Works ==
{| class="wikitable" style="float: right;"
! Command !! Number
|-
| < || 0
|-
| > || 1
|-
| + || 2
|-
| - || 3
|-
| . || 4
|-
| , || 5
|-
| [ || 6
|-
| ] || 7
|}
To rewrite a program from Brainfuck to TheLang, follow these steps:
# Convert each command to its corresponding number
# Convert the reversed sequence to an octal (base8) number.
# Enter that many "the"s.
=== Example ===
Let's encode this [[Brainfuck]] code:
<pre>--.</pre>
It prints character letter thorn (U+00FE in unicode).
# Convert the numbers: --. -> 334
# Convert reversed sequence to octal number: 334 -> 0o433 (283)
# Append the that many times
<pre>
tema5002@polyester:~$ git clone https://github.com/antigrav-technologies/TheLang.git
...
tema5002@polyester:~$ cd TheLang/
tema5002@polyester:~/TheLang$ make all
gcc main.c -o TheLang -O3 -Wall -Wextra -Werror -lm
tema5002@polyester:~/TheLang$ python3 -c 'print("the "*0o433)' > a.the
tema5002@polyester:~/TheLang$ ./TheLang a.the
þ
</pre>
=== Another example
Let's encode this code:
<pre>.+[.+]</pre>
It prints the entire ascii charset.
# Convert the numbers: .+[.+] -> 426427
# Convert reversed sequence to octal number: 426427 -> 0o724624 (240020)
<pre>
tema5002@polyester:~/TheLang$ python3 -c 'print("the "*0o724624)' > a.the
tema5002@polyester:~/TheLang$ ./TheLang a.the
�123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
tema5002@polyester:~/TheLang$
</pre>
I would show more examples, but I will run out of storage. Feel free to use TheLang to test your storage capacity.
== Implementation ==
* Official C-Based Interpreter: https://github.com/antigrav-technologies/TheLang
[[Category:Implemented]] [[Category:Cell-based]] [[Category:Brainfuck derivatives]] [[Category:Turing complete]] [[Category:Languages]] [[Category:2024]]' |
Lines added in edit (added_lines) | [
0 => '== TheLang ==',
1 => 'TheLang is an esoteric programming language by [[User:Tema5002|tema5002]] derived from [[Brainfuck]]. It's primary interpreter is written in C.',
2 => '',
3 => '== How It Works ==',
4 => '{| class="wikitable" style="float: right;"',
5 => '! Command !! Number',
6 => '|-',
7 => '| < || 0',
8 => '|-',
9 => '| > || 1',
10 => '|-',
11 => '| + || 2',
12 => '|-',
13 => '| - || 3',
14 => '|-',
15 => '| . || 4',
16 => '|-',
17 => '| , || 5',
18 => '|-',
19 => '| [ || 6',
20 => '|-',
21 => '| ] || 7',
22 => '|}',
23 => 'To rewrite a program from Brainfuck to TheLang, follow these steps:',
24 => '# Convert each command to its corresponding number',
25 => '# Convert the reversed sequence to an octal (base8) number.',
26 => '# Enter that many "the"s.',
27 => '',
28 => '=== Example ===',
29 => 'Let's encode this [[Brainfuck]] code:',
30 => '<pre>--.</pre>',
31 => 'It prints character letter thorn (U+00FE in unicode).',
32 => '',
33 => '# Convert the numbers: --. -> 334',
34 => '# Convert reversed sequence to octal number: 334 -> 0o433 (283)',
35 => '# Append the that many times',
36 => '<pre>',
37 => 'tema5002@polyester:~$ git clone https://github.com/antigrav-technologies/TheLang.git',
38 => '...',
39 => 'tema5002@polyester:~$ cd TheLang/',
40 => 'tema5002@polyester:~/TheLang$ make all',
41 => 'gcc main.c -o TheLang -O3 -Wall -Wextra -Werror -lm',
42 => 'tema5002@polyester:~/TheLang$ python3 -c 'print("the "*0o433)' > a.the',
43 => 'tema5002@polyester:~/TheLang$ ./TheLang a.the',
44 => 'þ',
45 => '</pre>',
46 => '=== Another example',
47 => 'Let's encode this code:',
48 => '<pre>.+[.+]</pre>',
49 => 'It prints the entire ascii charset.',
50 => '# Convert the numbers: .+[.+] -> 426427',
51 => '# Convert reversed sequence to octal number: 426427 -> 0o724624 (240020)',
52 => '<pre>',
53 => 'tema5002@polyester:~/TheLang$ python3 -c 'print("the "*0o724624)' > a.the',
54 => 'tema5002@polyester:~/TheLang$ ./TheLang a.the',
55 => ' ',
56 => '',
57 => '',
58 => '�123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~',
59 => ' tema5002@polyester:~/TheLang$',
60 => '</pre>',
61 => 'I would show more examples, but I will run out of storage. Feel free to use TheLang to test your storage capacity.',
62 => '== Implementation ==',
63 => '* Official C-Based Interpreter: https://github.com/antigrav-technologies/TheLang',
64 => '',
65 => '[[Category:Implemented]] [[Category:Cell-based]] [[Category:Brainfuck derivatives]] [[Category:Turing complete]] [[Category:Languages]] [[Category:2024]]'
] |