Open top menu
Saturday, April 11, 2015

Hmm... agak aneh ya . Tapi memnag demikian nama nya. Brainfuck Programming Language. Brainfuck adalah salah satu bahasa pemrograman yang diciptakan oleh Urban Muller pada tahun 1993, dengan tujuan diimplementasi pada compiler yang kecil.

Saya pertama mengenal bahasa Pemrograman ini kemarin pas ikut Cyber Defence. Dan disini saya akan share cara menerjemahkan Brainfuck sendiri.



Brainfuck Programming Language sendiri terdiri dari delapan perintah, dimana masing masing diwakili oleh karakter tunggal.



> Increment the pointer.

< Decrement the pointer.

+ Increment the byte at the pointer.

- Decrement the byte at the pointer.

. Output the byte at the pointer.

, Input a byte and store it in the byte at the pointer.

[ Jump forward past the matching ] if the byte at the pointer is zero.

] Jump backward to the matching [ unless the byte at the pointer is zero.





The semantics of the Brainfuck commands can also be succinctly expressed in terms of C, as follows (assuming that p has been previously defined as a char*):



> becomes ++p;

< becomes --p;

+ becomes ++*p;

- becomes --*p;

. becomes putchar(*p);

, becomes *p = getchar();

[ becomes while (*p) {

] becomes }








Sekian, semoga bermanfaat ya :D


Different Themes
Written by Kcnewbie

Ikatlah ilmu dengan menuliskanya.

0 comments