um um yeah err hm yeah uhhhhhhhh then ummmm uhhh errrr uhh errr ummmmm yeah err uh then heh then err um heh but um um yeah err heh no oops then but oops heh oops oops oops oops oops oops oops oops um then heh then uhhhhhhhhh no oops oops then um err uh then heh then err um heh but um um yeah err heh no oops then but oops heh oops oops oops oops oops oops oops um then heh then uhhhhhhhh no oops oops then um err uh then heh then err um heh but um um yeah err heh no oops then but oops heh oops oops oops oops oops oops um then heh then uhhhhhhh no oops oops then um err uh then heh then err um heh but um um yeah err heh no oops then but oops heh oops oops oops oops oops um then heh then uhhhhhh no oops oops then ummmmmmm uh errr uh then heh then err um heh but um um yeah err heh no oops then but oops heh oops oops oops oops um then heh then uhhhhh no oops oops then umm err uh then heh then err um heh but um um yeah err heh no oops then but oops heh oops oops oops um then heh then uhhhh no oops oops then ummmmmm uhhh ummmmm errrrrr uh then heh then err um heh but um um yeah err heh no oops then but oops heh oops oops um then heh then uhhh no oops oops then umm err uh then heh then err um heh but um um yeah err heh no oops then but oops heh oops um then heh then uhh no oops oops oops okay
This was not easy. Unsure is a new stack based language I've created, that uses words people tend to say when they're not sure about something.
It's kind of hard to explain how such a large program works, but I'll try to give a high-level explanation. First, here's an expanded version of this program:
um um yeah err hm yeah uhhhhhhhh then ummmm uhhh errrr uhh errr ummmmm yeah err uh
then heh then err um heh
but um um yeah err heh no oops then
but oops heh oops oops oops oops oops oops oops oops um then heh then uhhhhhhhhh no oops oops then um err uh
then heh then err um heh
but um um yeah err heh no oops then
but oops heh oops oops oops oops oops oops oops um then heh then uhhhhhhhh no oops oops then um err uh
then heh then err um heh
but um um yeah err heh no oops then
but oops heh oops oops oops oops oops oops um then heh then uhhhhhhh no oops oops then um err uh
then heh then err um heh
but um um yeah err heh no oops then
but oops heh oops oops oops oops oops um then heh then uhhhhhh no oops oops then ummmmmmm uh errr uh
then heh then err um heh
but um um yeah err heh no oops then
but oops heh oops oops oops oops um then heh then uhhhhh no oops oops then umm err uh
then heh then err um heh
but um um yeah err heh no oops then
but oops heh oops oops oops um then heh then uhhhh no oops oops then ummmmmm uhhh ummmmm errrrrr uh
then heh then err um heh
but um um yeah err heh no oops then
but oops heh oops oops um then heh then uhhh no oops oops then umm err uh
then heh then err um heh
but um um yeah err heh no oops then
but oops heh oops um then heh then uhh no oops oops
oops okay
The first part sets up the stacks. There are two stacks, one of which is selected as the active stack. The first stack contains a 0
at the bottom (the return value), as well as 8 copies of the input character's ASCII character code, negated.
After this, there are 8 sections to check for equality (first one shown as an example):
then heh then err um heh
but um um yeah err heh no oops then
but oops heh oops oops oops oops oops oops oops oops um then heh then uhhhhhhhhh no oops oops then um err uh
The first line will pop the first stack and add it to the first, which in this case is 43
(the character code for +
). It also pushes 1
to the first stack. The next line is essentially an if statement, which is used to create a NOT operator by pushing 0
to the first stack if the result of adding the character code is not 0
(meaning they are not the same).
The third line is the most complicated. It starts with a sort of else statement, as it only runs when the second line's if statement doesn't push 0
(and therefore the character code was 43). It will then replace the bottom of the first stack with 1
, the new output.
Finally, after the "else statement", the character code is incremented to 44, for ,
, and the process is repeated 7 times.
The last line, oops okay
, just outputs the bottom item in the first stack, as the previous operations have cleared it out except for one copy of the input (oops
discards the top of the stack, and okay
outputs).
There's definitely a few bytes I could golf here and there, might work on it later.
main(){}
and all of that in C answers) \$\endgroup\$