La Weá

From Esolang
Jump to: navigation, search

La Weá is an esoteric programming language created by Rodrigo Pelissier and released on September 18, 2018. It is inspired by COW and Brainfuck. It consists of 16 commands, each represented by a highly colloquial term in Chilean Spanish and it is Turing-complete. Commands must be separated; extra whitespaces and newlines are ignored; single-line comments are preceded by a #.

Commands

Command Description
maricón Decrements current cell value by 1.
maraco Decrements current cell value by 2.
weón Increments current cell value by 1.
aweonao Increments current cell value by 2.
maraca Sets current cell value to 0.
chucha Moves back one cell.
puta Moves forward one cell.
pichula If current cell value is 0, moves the instruction pointer after the matching tula command.
tula If current cell value is not 0, moves the instruction pointer after the matching pichula command.
pico Moves the instruction pointer after the closest tula command, regardless of the current cell value.
ctm Prints current cell value to STDOUT as an ASCII character.
quéweá Reads ASCII character from STDIN and stores it in the current cell.
chúpala Prints current cell value to STDIN as an integer.
brígido Reads integer from STDIN and stores it in the current cell.
perkin Copies current cell value if there is no copy; otherwise, pastes the copied value and resets the copy.
mierda Terminates program.

Sample code

Hello, World!:

aweonao aweonao aweonao aweonao aweonao pichula puta aweonao aweonao puta aweonao aweonao aweonao
weón puta aweonao aweonao aweonao aweonao aweonao puta aweonao aweonao aweonao aweonao aweonao weón
chucha chucha chucha chucha maricón tula puta puta aweonao ctm puta weón ctm puta maraco ctm ctm
aweonao weón ctm chucha chucha chucha aweonao aweonao ctm maraco maraco maraco maraco maraco maraco
ctm puta puta maraco maraco maraco maraco maraco maraco maraco ctm puta ctm aweonao weón ctm maraco
maraco maraco ctm chucha aweonao aweonao aweonao aweonao aweonao aweonao weón ctm chucha chucha weón
ctm puta puta puta puta aweonao aweonao aweonao aweonao aweonao ctm

Fibonacci sequence:

aweonao aweonao aweonao aweonao aweonao puta weón chúpala chucha ctm puta puta weón chúpala chucha
chucha ctm pichula puta puta perkin puta perkin chucha chucha pichula puta puta weón chucha chucha
maricón tula puta perkin chucha perkin puta puta chúpala perkin chucha perkin chucha chucha ctm tula

Implemetation

#!/usr/bin/ruby

h = {
    'puta' => 'p+=1;',
    'chucha' => 'p-=1;',
    'weón' => 'm[p]+=1;',
    'aweonao' => 'm[p]+=2;',
    'maricón' => 'm[p]-=1;',
    'maraco' => 'm[p]-=2;',
    'maraca' => 'm[p]=0;',
    'ctm' => 'putc m[p];',
    'quéweá' => 'm[p]=STDIN.getbyte if !STDIN.eof;',
    'pichula' => '(',
    'tula' => ')while(m[p]!=0);',
    'pico' => 'break;',
    'chúpala' => 'print m[p].to_s;',
    'brígido' => 'm[p] = Integer(gets) rescue 0;',
    'mierda' => 'exit;',
    'perkin' => 'if pf then pf=false; m[p]=v; else pf=true; v=m[p]; end;'
}

r = Regexp.union(Regexp.union(h.keys.sort{|a,b|b.length<=>a.length}),/./);
eval 'm=Hash.new(p=0);pf=false;'+ARGF.read.downcase.gsub(/[\n\t ]+/," ").gsub(r,h);

See also

Similar languages:

External resources

La Weá on GitHub

JavaScript based online interpreter