Editing (section) FiM++ 0 You are not logged in. The rich text editor does not work with JavaScript switched off. Please either enable it in your browser options, or visit your preferences to switch to the old MediaWiki editor == Example Programs == A program that simply uses one paragraph to print "Hello World" and exits: {{codeblock|{{code|keyword|Dear}}{{code|whitespace| }}{{code|report|Princess Celestia}}{{code|punctuation|:}}{{code|report|Hello World}}{{code|punctuation|!}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|<STRONG>Today</STRONG> I learned}}{{code|whitespace| }}{{code|paragraph|how to say hello world}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|I said}}{{code|whitespace| }}{{code|literal|“Hello, World!”}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|That's all about}}{{code|whitespace| }}{{code|paragraph|how to say hello world}}{{code|punctuation|.}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|Your faithful student}}{{code|punctuation|,}}{{code|comment| Kyli Rouge}}{{code|punctuation|.}}}} A program that uses two paragraphs, a [[mane paragraph]] and a utility paragraph, to add all the numbers from 1 to 100: {{codeblock|{{code|keyword|Dear}}{{code|whitespace| }}{{code|report|Princess Celestia}}{{code|punctuation|:}}{{code|whitespace| }}{{code|report|I can add}}{{code|punctuation|!}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|<STRONG>Today</STRONG> I learned}}{{code|whitespace| }}{{code|paragraph|how to add a lot}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|Did you know that}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|the answer}}{{code|whitespace| }}{{code|keyword|was}}{{code|whitespace| }}{{code|paragraph|how to add}}{{code|whitespace| }}{{code|keyword|using}}{{code|whitespace| }}{{code|literal|1}}{{code|whitespace| }}{{code|keyword|and}}{{code|whitespace| }}{{code|literal|100}}{{code|punctuation|?}}{{code|whitespace|<BR/>}}{{code|keyword|I said}}{{code|whitespace| }}{{code|variable|the answer}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|That's all about}}{{code|whitespace| }}{{code|paragraph|how to add a lot}}{{code|punctuation|.}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|I learned}}{{code|whitespace| }}{{code|paragraph|how to add}}{{code|whitespace| }}{{code|keyword|to get}}{{code|whitespace| }}{{code|type|a number}}{{code|whitespace| }}{{code|keyword|using}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|first}}{{code|whitespace| }}{{code|keyword|and}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|last}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|Did you know that}}{{code|whitespace| }}{{code|type|the number}}{{code|whitespace| }}{{code|variable|sum}}{{code|whitespace| }}{{code|keyword|was}}{{code|whitespace| }}{{code|literal|0}}{{code|punctuation|?}}{{code|whitespace|<BR/>}}{{code|keyword|As long as}}{{code|whitespace| }}{{code|variable|first}}{{code|whitespace| }}{{code|operator|was no more than}}{{code|whitespace| }}{{code|variable|last}}{{code|punctuation|,}}{{code|whitespace|<BR/>}}{{code|variable|sum}}{{code|whitespace| }}{{code|keyword|became}}{{code|whitespace| }}{{code|variable|sum}}{{code|whitespace| }}{{code|operator|plus}}{{code|whitespace| }}{{code|variable|first}}{{code|punctuation|.}}{{code|punctuation|.}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|variable|first}}{{code|whitespace| }}{{code|operator|got one more}}{{code|punctuation|.}}{{code|whitespace|<BR/>}}{{code|keyword|That's what I did}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|Then you get}}{{code|whitespace| }}{{code|variable|sum}}{{code|punctuation|!}}{{code|whitespace|<BR/>}}{{code|keyword|That's all about}}{{code|whitespace| }}{{code|paragraph|how to add}}{{code|punctuation|!}}{{code|whitespace|<BR/><BR/>}}{{code|keyword|Your faithful student}}{{code|punctuation|,}}{{code|comment| Kyli Rouge}}{{code|punctuation|.}}}} === Mirror in Java === FiM++ can be translated into [[Wikipedia:Java (programming language)|Java]] relatively easily. Here's the above Hello World example in Java: {{codeblock|<source lang="java"> public class HelloWorld extends Object { public static void main(String[] args) { System.out.println("Hello, World!"); } } </source>}} And here's the above addition program: {{codeblock|<source lang="java"> public class ICanAdd extends Object { public static void main(String[] args) { double theAnswer = howToAdd(1, 100); System.out.println(theAnswer); } public static double howToAdd(double first, double last) { double sum = 0; while (first <= last) { sum = sum + first;;; first++; } return sum; } } </source>}} Loading editor Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above. Insert: – — … ° ≈ ≠ ≤ ≥ ± − × ÷ ← → · § Sign your username: ~~~~ Wiki markup: {{}} | [] [[]] [[Category:]] #REDIRECT [[]] <s></s> <sup></sup> <sub></sub> <code></code> <blockquote></blockquote> <ref></ref> {{Reflist}} <references/> <includeonly></includeonly> <noinclude></noinclude> {{DEFAULTSORT:}} <nowiki></nowiki> <!-- --> <span class="plainlinks"></span> Symbols: ~ | ¡ ¿ † ‡ ↔ ↑ ↓ • ¶ # ¹ ² ³ ½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ∞ ‘ “ ’ ” «» ¤ ₳ ฿ ₵ ¢ ₡ ₢ $ ₫ ₯ € ₠ ₣ ƒ ₴ ₭ ₤ ℳ ₥ ₦ № ₧ ₰ £ ៛ ₨ ₪ ৳ ₮ ₩ ¥ ♠ ♣ ♥ ♦ View this template This field is a spam trap. DO NOT fill it in! Edit summary Preview Mobile Desktop Show changes