Skip to content

Instantly share code, notes, and snippets.

View takahisa's full-sized avatar

Takahisa Watanabe takahisa

  • Cybozu, Inc
  • Tokyo, Japan
View GitHub Profile
@takahisa
takahisa / gist:1160844
Created August 21, 2011 16:55
VBAで書いたBefungeインタプリタ
Option Explicit On
Dim sheet As Worksheet
Dim count As Long
Sub Main()
Dim cell As String
Dim x, y As Long
Dim a, b, c As Long
Dim align As Integer
@takahisa
takahisa / bf.txt
Created August 17, 2011 22:45
HeadacheによるBrain F*ckのソースコードだけどどっかの括弧が対応取れてなくてバグってる。あとジャンプ命令あたりも怪しい
let source : "+++++++++[>++++++++>+++++++++++>+++++<<<-]>.>++.+++++++..+++.>-.------------.<++++++++.--------.+++.------.--------.>+.\0"
let item :
lambda n ->
lambda list ->
if ( = n 0 )
then head list
else item ( - n 1 ) ( tail list )
let state :
@takahisa
takahisa / gist:1033860
Created June 19, 2011 07:20
パーサーテスト用の入力ファイル
module std {
def fib = 1 -> Int
=> 1
  def fib = 2 -> Int
=> 1
def fib = n:Int -> Int
=> fib(n-2) + fib(n-1)
}
module program {