CJam
Hi; Isaq
\~O~/
(1)
@O@
/ \*
*~50 Times!
;; WINNINGS ;;
;; ;;
;;] $10000O ;;
p1 is "where Kings sit', according to Shakesphere or someone. All I know is that after 4 straight years
of earning second in the national clown contest, it sure feels great to be on top for once. My clown
ASCII art could use some work, but hopefully I did a solid representation of our troupe. I can't believe
this was the one year you were sick, but we went and earned the $100k in your absence.
See you Monday,
Ethan
'I remain just one thing, and one thing only, and that is a clown." -
Try it online
Apparently my job is at a clown troupe that just won the grand prize, my boss's name is Isaq, and my signature didn't work and forgot to credit Charlie Chaplin.
Notes:
This was afwul. CJam throws an error on any character that isn't a command or whitespace, or when we try to take input but there isn't any, or you try to do a command but the stack's empty, etc. This means that knruvxylqo
is unusable for the actual code (except the one q
at the start to load in the array), and emth
are also notably difficult. So of the famous rstlne from Wheel of Fortune, we have left... s. English is going to be hard. I'll be explaining what happens on each character, but not really why because there's so much to go through, especially with the clown. (also I don't know why a couple of the things work shh...)
Explanation:
I tried a few greetings to open us off (Greetings
, Hello
, etc.) and Hi
was the only viable one. The others either threw errors or consumed input. Hi
just pushes 17 and makes sure it's an int. The ;
then throws that 17 away.
Isaq
gives us ["18"]
by pushing 18, stringifying it, and putting it in an array. q
then gives us our input array as a string.
Row one of the clown: \
swaps our two elements. ~
takes "18" out of the array. O
pushes an empty string. ~
makes it disappear. /
throws away "18" but puts our input string into an array.
Row two: (
takes our input out of the array, but leaves an empty string before it on the stack. 1
pushes 1. )
increments that 1.
Row three I brute-forced after writing row 5, because I knew kinda what I needed it to do. @
rotates our array so the input is on bottom and empty string on top, O
adds another empty string, and @
rotates it so 2 is on top.
Row four: /
gets rid of the 2, \
swaps the identical empty strings, and *
gets rid of one of them.
Out of the clown now. The next *
gets rid of our other empty string, leaving just the input string. Finally, we parse it into a bunch of numbers with ~
. 50 Times!
ends up just pushing a 50 and a 0 when all is said and done.
Now into the winnings block. ;;
gets rid of our 50 and 0. WINNINGS
takes advantage of the fact that CJam doesn't yell at you if you scream at it because capital letters are variables. Unfortunately, that means it also pushes a bunch of junk. The next 8 ;
s take care of that.
We're just back to our input numbers now. We'll use a not-so-sneaky ]
to turn them into an array and $
to sort them. We just need to output with p
now, but unfortunately for it to make sense we need some money first. We push 10000
, plus an O
because we need two things for the upcoming semicolons to destroy.
After a simple p
, we've printed our sorted array! It's not much of a letter though. 1
and is
are harmless. We start a quote with "
, then end it with '
to let us write in English unimpeded. We do the inverse with a quote at the end to close up, and the -
throws what we have left on the stack away so it doesn't automatically output. This way, it looks like we intended to attribute the quote, but forgot.