> "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo"
>> Output 1
Try it online!
Well, this is embarrassing...
The first line alone could even be enough, as a function returning the string
For something a bit more interesting, here's my previous solution:
> "Buffalo "
> "buffalo "
>> 1+2
>> 3+3
>> 2+2
>> 5+3
>> 4+6
> 63
>> 7ᶠ8
>> Output 9
Try it online!
First approach to the language of the month for me :) It looks like building the string by manually concatenating pieces is the best approach in Whispers.
Explanation
Whispers starts the execution from the last line of the program, and then follows references from there. Any number in a line starting with >>
refers to the result of the corresponding line, while numbers in lines starting with >
have their normal value. We can only have a single operation per line (hence why so many lines).
Most lines here simply concatenate two strings, while line 9 takes the first 63
characters from the string in line 7, which is all except for the trailing space. It should be pretty easy to read, but here's the value computed by each line:
> "Buffalo " 1:"Buffalo "
> "buffalo " 2:"buffalo "
>> 1+2 3:"Buffalo buffalo "
>> 3+3 4:"Buffalo buffalo Buffalo buffalo "
>> 2+2 5:"buffalo buffalo "
>> 5+3 6:"buffalo buffalo Buffalo buffalo "
>> 4+6 7:"Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo "
> 63 8:63
>> 7ᶠ8 9:"Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo"
>> Output 9 10:prints out line 9