Saying Steemit is Awesome on ArnoldC [@trumpman's challenge]
So, our fellow @trumpman posted a challenge to write something in Trumpscript or ArnoldC. Both are humorous programming languages, based on the personalities of Donald Trump (for Trumpscript) and Arnold Schwarzenegger (for ArnoldC)
I was feeling quirky, so I quickly hacked something up on ArnoldC, and posted it as a comment. Then @trumpman encouraged me to, and I quote his phrase,
[...]include a mini tutorial too for dumbfucks like me!!!
So let's see what I made:
This is the test run, to compile the script and make sure it runs correctly. It took me a while as it was my first encounter with ArnoldC
This is the code:
IT'S SHOWTIME HEY CHRISTMAS TREE showawesomeness YOU SET US UP @NO PROBLEMO HEY CHRISTMAS TREE n YOU SET US UP 0 STICK AROUND showawesomeness GET TO THE CHOPPER n HERE IS MY INVITATION n GET UP 1 ENOUGH TALK TALK TO THE HAND "STEEMIT IS AWESOME, SO IS @utopian-io AND @dimitrisp!" GET TO THE CHOPPER showawesomeness HERE IS MY INVITATION 5 LET OFF SOME STEAM BENNET n ENOUGH TALK CHILL TALK TO THE HAND "got it?" YOU HAVE BEEN TERMINATED
Let's take it line by line and explain it a little bit:
IT'S SHOWTIME - This is the opening line. Some languages use an opening statement to show the compiler that this is where all magic begins.
The next 2 keywords appear 2 times in a row, so I'll explain it once ;)
HEY CHRISTMAS TREE varname declares a variable of INT type. This is an integer, a round number without floating points. varname is the name of the variable.
YOU SET US UP thisvalue follows the previous statement immediatelly, in order to set the DEFAULT value of varname to thisvalue
@NO PROBLEMO following the first
YOU SET US UP statement is the equivallent of
TRUE in other languages. This is used for the loop we are going to get into, in a little bit.
Now we get to the really interesting part, that took me a while to get a hang of how it works.
STICK AROUND is the equivalent
while statement. All commands inbetween
STICK AROUND and
CHILL will be executed as long as "showawesomeness" is
true (or in ArnoldC's statement,
GET TO THE CHOPPER n opens the variable n to assign a value.
HERE IS MY INVITATION n is used to get/assign the value of/to the variable n.
GET UP n is used to add 1 to variable n. (Equivalent to
i = i + 1 or
i++ in various other languages)
ENOUGH TALK closes the variable n that we opened with
GET TO THE CHOPPER
TALK TO THE HAND "text text text" is used to print "text text text" to the console window.
As we already talked about
GET TO THE CHOPPER,
ENOUGH TALK and
HERE IS MY INVITATION, I'll skip them
LET OFF SOME STEAM BENNET will check the previous statements's value if it is greater than the variable's value. I am assuming here, if the condition is
NO PROBLEMO, it returns true, and that causes our program to run 5 times before exiting the loop with
YOU HAVE BEEN TERMINATED is used to let the compiler know that the magic has ended.
Some stuff may not make sense. I know it didn't to me at first, this is confusing as hell! (It's already hard enough to learn a proper programming language, we don't need to have full sentences as statements :P )
Also, I'm not expert in ArnoldC, although I would love to make a carreer out of it :D
I've submitted this to @utopian-io's tutorial category. I expect nothing in terms of compensation, but since this contribution is released under the Unlicense license on my part, I guess I wanted to spread more awareness to this comedy of a programming language!
Now go make something funny, and then go and support Utopian as witness, by clicking here.
15% of this post's payout will be evenly split between @utopian.pay for its service to the Open Source community, @steembasicincome for their awesome experiment, and @trumpman for coming up with this awesome challenge