📜 ⬆️ ⬇️

ArnoldC: a programming language from Schwarzenegger quotes

image

Good day, Habr. I think many people who have at least once heard about programming have heard about esoteric programming languages. The same Brainfuck.

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++ .>+.+++++++..+++.>++.<<+++++++++++++++.>.+++. ------.--------.>+.>. 

Only one kind of shakes, but who would have thought that there is a person who can create a programming language from the quotes of a famous Hollywood actor.
Finnish programmer Lauri Hartikka has published a description and compiler for the ArnoldC programming language on Github. As teams in ArnoldC quotes are used heroes Arnold Schwarzenegger.

Code example

 BECAUSE I'M GOING TO SAY PLEASE a TALK TO THE HAND "a is true" BULLSHIT TALK TO THE HAND "a is not true" YOU HAVE NO RESPECT FOR LOGIC 

')
Moreover, the language is very multifunctional, with the help of it we can perform simple actions, such as

Addition

 GET UP operand 

Subtraction

 GET DOWN operand 

Multiplication

 YOU'RE FIRED operand 

Division

 HE HAD TO SPLIT operand 


image

Key operators (with links to the phrase)


In the example below, we can see how logical operators are implemented.

a = (b || c) && d

 GET TO THE CHOPPER a HERE IS MY INVITATION b CONSIDER THAT A DIVORCE c KNOCK KNOCK d ENOUGH TALK 


Here is an example more complicated.
 IT'S SHOWTIME HEY CHRISTMAS TREE result1 YOU SET US UP 0 HEY CHRISTMAS TREE result2 YOU SET US UP 0 HEY CHRISTMAS TREE result3 YOU SET US UP 0 HEY CHRISTMAS TREE result4 YOU SET US UP 0 GET YOUR ASS TO MARS result1 DO IT NOW modulo 9 4 TALK TO THE HAND result1 GET YOUR ASS TO MARS result2 DO IT NOW modulo 4795 87 TALK TO THE HAND result2 GET YOUR ASS TO MARS result3 DO IT NOW modulo 3978 221 TALK TO THE HAND result3 GET YOUR ASS TO MARS result4 DO IT NOW modulo 5559 345 TALK TO THE HAND result4 YOU HAVE BEEN TERMINATED LISTEN TO ME VERY CAREFULLY modulo I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE dividend I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE divisor GIVE THESE PEOPLE AIR HEY CHRISTMAS TREE quotient YOU SET US UP 0 HEY CHRISTMAS TREE remainder YOU SET US UP 0 HEY CHRISTMAS TREE product YOU SET US UP 0 GET TO THE CHOPPER quotient HERE IS MY INVITATION dividend HE HAD TO SPLIT divisor ENOUGH TALK GET TO THE CHOPPER product HERE IS MY INVITATION divisor YOU'RE FIRED quotient ENOUGH TALK GET TO THE CHOPPER remainder HERE IS MY INVITATION dividend GET DOWN product ENOUGH TALK I'LL BE BACK remainder HASTA LA VISTA, BABY 


In this code snippet, the function is declared modularly and used with the main method.

HelloWorld.arnoldc

 IT'S SHOWTIME TALK TO THE HAND "hello world" YOU HAVE BEEN TERMINATED 


You can read more about this language on the author's page .

Source: https://habr.com/ru/post/214189/


All Articles