發表文章

目前顯示的是 2月, 2020的文章

怪怪的程式語言名稱:Brainfuck

若您覺得文章寫得不錯,請點選網誌上的廣告,來支持小編,謝謝。 最近在 ptt Gossiping 版的jserv 的一篇回文 https://www.ptt.cc/bbs/Gossiping/M.1555612071.A.14C.html 得知 Brainfuck 也是個程式語言,於是小編自己也來寫一個 Brainfuck interpreter。先來了解 Brainfuck 的指令吧。 Brainfuck指令說明 ============底下文字從  https://en.wikipedia.org/wiki/Brainfuck  節錄出來:============ Character Meaning > increment the  data pointer  (to point to the next cell to the right). < decrement the data pointer (to point to the next cell to the left). + increment (increase by one) the byte at the data pointer. - decrement (decrease by one) the byte at the data pointer. . output the byte at the data pointer. , accept one byte of input, storing its value in the byte at the data pointer. [ if the byte at the data pointer is zero, then instead of moving the  instruction pointer  forward to the next command,  jump  it  forward  to the command after the  matching   ]  command. ] if the byte at the data poin...