literature

FiM++ Programming - Hello World, 99 Jugs of Cider

Deviation Actions

DeftCrow's avatar
By
Published:
26.3K Views

Literature Text

Dear Princess Celestia: Letter One

Today I Learned an important lesson about friendship.

I learned how to write "Hello World!"

Your faithful student, Twilight Sparkle.

P.S. In this case, the syntax is similar to C++.

----------------------------------------------------------------------

Dear Princess Celestia: Letter One

I wrote "Hello World!"

Your faithful student, Twilight Sparkle.

P.S. In this case, the syntax mirrors that of Python syntax. I'll leave it to you, readers, to decide which one you deem better. -Twilight Sparkle

----------------------------------------------------------------------

Dear Princess Celestia: Letter One

Today I learned how to sing Applejack's Drinking Song.

I learned Applejack's Drinking Song with Applejack.

Did you know that Applejack likes the number 99?

I did this while Applejack had more than 1.
I sang " 'Applejack' jugs of cider on the wall, 'Applejack' jugs of cider,"
Applejack got one less.

When Applejack had more than 1,
I sang "Take one down and pass it around, 'Applejack' jugs of cider on the wall."
In the end, I did this instead.
I sang "Take one down and pass it around, 1 jug of cider on the wall.
1 jug of cider on the wall, 1 jug of cider.
Take one down and pass it around, no more jugs of cider on the wall."
That's what I did.

In the end, I did this instead.
I sang "No more jugs of cider on the wall, no more jugs of cider.
Go to the store and buy some more, 99 jugs of cider on the wall."
That's what I did.

That's about Applejack's Drinking Song with Applejack!

Your faithful student, Twilight Sparkle.

P.S. Twilight's drunken state truly frightened me, so I couldn't disregard her order to send you this letter. Who would have thought her first reaction to hard cider would be this... explosive? I need your advice, your help, everything, on how to deal with her drunk... self. -Spike
When I saw the post for FiM++, I couldn't resist.

EqD Post: [link]

99 Bottles of Beer: [link]

I know the above is probably the worst way to implement 99 Bottles of Beer in the world, but I tried to keep it in a way that remotely resembles a letter to Princess Celestia.

For the name of the language, I humbly suggest... "Friendship Reports." With the actual period. (Abbreviated: FR., read "Ef Ar Dot.") Because dots are obviously important. You'll understand if you have played EVE long enough.

=> "Today I Learned..." : Main() function. Takes no arguments. May be omitted for letters without lessons(functions).
=>=> "an important lesson about friendship." : Generic opening statement.
=>=> "<comment>": Opening statement with comment on the entire letter(code). Everything written after "Today I Learned..." is considered a comment until the next period.

=> I sang / wrote / said "" : print("")
=>=> I sang "... '<var>'" : print("... '<var>'")
=> I learned <name> (with <var>).: Define function as <name>, taking <var> as arguments.
=> => That's about <function_name> (with <arg>)! : End function definition.

=> I learned <how to> <method>.: Perform single <method>. Method ends at next period.

=> got/had <num> more : +<num>
=> got/had <num> less : -<num>

=> When <var> had more than <value> : if <var> > <value>
=> I did this while <var> <comparison> <value> : for (<var> <comparison> <value>)
=>=> That's what I did. : General closing statement for all at"I did this while" and "When" (while / if) statements.

=> Did you know that <var> is/likes (the <type>) <value>? : Assign value with enforced type.

=> P.S. : Text comment, as in // .
=> By the way, <content>.: In-line comment with <content>. Comment ends at next period. (Similar to /* */ in C++.)

Ver. 0.01A - Modified "if" statements as "When," as per croaklieuhunt's input.
Ver. 0.01B - Added "That's what I did.", general closing statement for all "When" and "I did this while" statements.
Ver. 0.02 - Decided on main() function. Updated "Hello World!" program to make sense. Updated description with function definition. Updated description for performing a single method.
© 2012 - 2024 DeftCrow
Comments75
Join the community to add your comment. Already a deviant? Log In
SomaticHaberdashery's avatar
A strange yet beautiful thing.