Yes, the list is entirely subjective. But that's what poetry is! So how do you actually write programs in CherryBlossom? Well, it's pretty simple. Imagine that you're writing in brainfuck, but instead, use words that map to the brainfuck instruction that you want to use. However, you have to make sure that you are conforming to the rules of haiku. What this also means is that the smallest CherryBlossom program will be three lines long. It also follows that in every CherryBlossom program, the number of lines will always be a multiple of three. Now let's look at some actual code! First, we have the obligatory "Hello World!" program. Let's look at the brainfuck version:
+++ +++ +++ + [ > +++ +++ + > +++ +++ +++ + > +++ > + <<< < - ] >++ . >+. +++ +++ +. . +++ . >++ . <<+ +++ +++ +++ +++ ++. >. +++ . --- --- . --- --- --. >+.
And now, the prettier CherryBlossom version:
your lovely fragrance heals me
every morning
remembering you,
dreaming of your lovely smile,
when will you come here?
floating butterflies
sunshine and summer flowers
a lovely morning
blossoming hillside
on a fragrant summer day
blooming, flowering.
I can remember
my happy dreams of summer
it was beautiful
flying doves, sunrays
beauty flying in sunshine
rain in the valley.
snow falls in moonlight,
returns to the mountainside.
lovely, beautiful.
view from mountaintop
is a beautiful painting,
in summer sunshine.
the fragrant flowers
and the pretty butterflies
spring by singing creek.
beautiful morning
butterflies by riverside
floating in sunshine.
such a lovely sight,
the valley waterfall is
in the spring sunshine.
sunrays and sunshine,
the butterflies and flowers
loving the new spring.
the pretty flowers
are dreaming of a summer
with the smiling sun.
music from heaven,
is melodious and sweet,
dreamy and happy.
the river is cold
and misty in the moonlight,
in the autumn chill.
winter riverside,
lonely, icy, and chilly
darkening evening
the lonely winter,
barren riverside ahead
a dreaming poet
Here is another listing of the same code. This time I've highlighted the words that map to brainfuck instructions. See if you can figure out how they map 🙂 It's pretty easy:
your lovely fragrance heals me
every morning
remembering you,
dreaming of your lovely smile,
when will you come here?
floating butterflies
sunshine and summer flowers
a lovely morning
blossoming hillside
on a fragrant summer day
blooming flowering.
i can remember
my happy dreams of summer
it was beautiful
flying doves, sunrays
beauty flying in sunshine
rain in the valley.
snow falls in moonlight,
returns to the mountainside
lovely beautiful
view from mountaintop
is a beautiful painting,
in summer sunshine
the fragrant flowers
and the pretty butterflies
spring by singing creek
beautiful morning
butterflies by riverside
floating in sunshine.
such a lovely sight,
the valley waterfall is
in the spring sunshine.
sunrays and sunshine,
the butterflies and flowers
loving the new spring.
the pretty flowers
are dreaming of a summer
with the smiling sun.
music from heaven,
is melodious and sweet,
dreamy and happy
the river is cold
and misty in the moonlight,
in the autumn chill.
winter riverside,
lonely, icy, and chilly
darkening evening
the lonely winter,
barren riverside ahead
a dreaming poet
This really is amazing. Now I can express myself AND make beautiful code all in one. Great work.
@TheMoonMaster
Thanks! That was the idea 😉 heh!
This is really cool!! BrainF**k was pretty much a disaster.
@Tushar Dadlani
Haha, thanks! Yeah I think that the intent with Brainfuck!
Saw your shameless plug on SO 🙂
This is so cool! I wish I had come up with something like this. I love it.
@anon
Thank you! 😀 It was definitely during some moments of boredom (and probably a little insanity) that I came up with this.
Hey, this is really interesting! I’m kind of new to programming, and I really want to try this out. Could you just explain how Im supposed to set up and run the interpreter?
@A
You need to download Perl and install a few modules. If you’re on Ubuntu, Perl should already be installed. You can start up CPAN by typing “cpan” and then installing the following modules.
GetOpt::Mixed
Term::ReadKey
Lingua::EN::Syllable
For Windows, there are some other options. You can install Strawberry Perl and use cpan to install the above modules.
You say that you’re new to programming; I would suggest not starting off with CherryBlossom. It is a Brainf*ck analog after all and Brainf*ck isn’t designed to be easy 🙂
kgswho