Rough Book

random musings of just another computer nerd

CherryBlossom

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:

beautiful jasmine
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:

beautiful jasmine
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

Popularity: 5% [?]

Pages: 1 2 3

9 Comments »

  1. This really is amazing. Now I can express myself AND make beautiful code all in one. Great work.

    ReplyReply

    Comment by TheMoonMaster | March 14, 2010

  2. @TheMoonMaster
    Thanks! That was the idea ;) heh!

    ReplyReply

    Comment by vivin | March 14, 2010

  3. Social comments and analytics for this post…

    This post was mentioned on Twitter by vi5in: @heisenthought @guusdk Here’s the actual project page with two samples and the interpreter (link is on last page)! http://bit.ly/bxB9Zt...

    Trackback by uberVU - social comments | March 15, 2010

  4. This is really cool!! BrainF**k was pretty much a disaster.

    ReplyReply

    Comment by Tushar Dadlani | May 28, 2010

  5. @Tushar Dadlani
    Haha, thanks! Yeah I think that the intent with Brainfuck!

    ReplyReply

    Comment by vivin | May 29, 2010

  6. Saw your shameless plug on SO :)

    This is so cool! I wish I had come up with something like this. I love it.

    ReplyReply

    Comment by anon | June 14, 2010

  7. @anon
    Thank you! :D It was definitely during some moments of boredom (and probably a little insanity) that I came up with this.

    ReplyReply

    Comment by vivin | June 14, 2010

  8. 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?

    ReplyReply

    Comment by A | August 26, 2010

  9. @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 :)

    ReplyReply

    Comment by vivin | September 3, 2010


Leave a Comment

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
All original content on these pages is fingerprinted and certified by Digiprove