|Arnold C A Schwarzenegger Based Language|
|Written by Lucy Black|
|Sunday, 02 March 2014|
New languages come and go, but this one seems likely to "stick around" (Predator). Its entire syntax is based on one line quotes from that well known programmer, movie star and State Governor, Arnold Schwarzenegger.
This may be a complete waste of time but it's funny and in a strange way it is a reminder of what code looks like to a beginner or a non-programmer.
To be clear there is nothing deep here, certainly not Arny's quotes.
To give you the flavor of the language, starting a program is the main method delimited by two appropriate quotes.
The print command is:
You get the idea.
So as is tradition, here is Hello World in ArnoldC
Things get more complicated when we move to consider expressions and logical operations. My favorite is
which is the equality operator.
The if then else construct is also nice:
And because this cannot go on forever, you can lookup the rest of ArnoldC at its GitHub page.
Oone last amusing example, a method is:
A complete program serves to illustrate the strangness of the language:
Just in case your ArnoldC isn't quite up to speed, the above prints the numbers 1 to 10.
It is also worth mentioning that its creator, Lauri Hartikka, has implemented the language and you can actually run the program given above and others like it.
Lauri justifies the time spent with:
"Although the one-liners of Arnold Schwarzenegger are fairly well known the true semantics of the uttering is yet to be understood. This project tries to discover new meanings from the Arnold movies with the means of computer science."
And I don't think we are talking semicolons here....
Once you have thought of ArnoldC it is obvious that there is a generic group of languages based on the principle. For example, CEastwood would have really good facilities for random number generation:
It puts a another spin on literate programming.
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
or email your comment to: email@example.com
|Last Updated ( Sunday, 02 March 2014 )|