LOLCODE, sebuah bahasa pemrogramman yang unik.

Baru-baru ini saya melihat-lihat bahasa pemrograman yang baru, yang saya akan jelajahi untuk menambah wawasan saya.

Lalu saya berakhir di bahasa pemrograman yang lucu dan unik. Lalu saya ketemu LOLCODE, dia script contohnya seperti ini:
HAI
CAN HAS STDIO? 
VISIBLE "HAI WORLD!" 
KTHXBYE
Kalau kamu bisa bahasa C, pasti ngerti. "HAI" untuk memulai script, STDIO itu merupakan library dimana sesuatu akan dijalankan. VISIBLE itu sama saja seperti PRINT, dengan kata "Hai World!". KTHXBYE sebenarnya akronim dari Ok Thanks Bye. Ini untuk mengakhiri script.

Lucu kan?

Ada lagi yang namanya "Shakespare", dia itu scriptnya seperti ini:



                   Act I: Hamlet's insults and flattery.
                   Scene I: The insulting of Romeo.
[Enter Hamlet and Romeo]
Hamlet:
You lying stupid fatherless big smelly half-witted coward! You are as
stupid as the difference between a handsome rich brave hero and thyself!
Speak your mind!
You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer's
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!
You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.
Speak your mind!
[Exit Romeo]
                   Scene II: The praising of Juliet.
[Enter Juliet]
Hamlet:
Thou art as sweet as the sum of the sum of Romeo and his horse and his
black cat! Speak thy mind!
[Exit Juliet]
                   Scene III: The praising of Ophelia.
[Enter Ophelia]
Hamlet:
Thou art as lovely as the product of a large rural town and my amazing
bottomless embroidered purse. Speak thy mind!
Thou art as loving as the product of the bluest clearest sweetest sky
and the sum of a squirrel and a white horse. Thou art as beautiful as
the difference between Juliet and thyself. Speak thy mind!
[Exeunt Ophelia and Hamlet]

Tambah aneh lagi, ada lagi namanya "BrainFuck". Untuk menulis kata "Hello World", itu seperti ini:

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

Tapi tetap saja, saya mau mencoba LOLCODE karena ini paling mudah.

Ini kode yang saya buat untuk pertama kalinya di LOLCODE:
HAI
CAN HAS STDIO?
I HAS A number
NUMBER R 1
BTW This is a comment

BOTH SAEM number AN 1, O RLY?
YA RLY
VISIBLE "Correct. number variable is 1"
NO WAI
VISIBLE "number variable is not 1"
OIC

KTHXBYE

Sebetulnya mudah dipahami. I HAS A number = mendeklarasikan variabel bernama 'number'. NUMBER R 1 = number itu isinya 1. BOTH SAEM number AN 1, O RLY? = if (number == 1) {, YA RLY = jika benar, NO WAI = jika salah. OIC itu untuk mengakhiri. Itu juga dari akronim Oh, I see.

Mudah kan? Nampaknya saya jual buku bisa laku ini. Hahahaha.

No comments:

Post a Comment