.lua

Lua:golf()[1]

条件演算子が無い → and/or で代用 a and b or c -- a?b:c ビットシフトが無い → 「 ^ 」で代用 n*2^i -- n<<i math.floor(n/2^i) -- n>>i math.floorが長い → 1の剰余(少数部)を引く math.floor(x/y) -- ↓ -- x/y-x/y%1 gmatch → gfind</i>

木、子→親

…なるほど。 tree = [[ (Root (Spine (Neck (Head)) (RClavicle (RUpperArm (RLowerArm (RHand)))) (LClavicle (LUpperArm (LLowerArm (LHand))))) (RHip (RUpperLeg (RLowerLeg (RFoot)))) (LHip (LUpperLeg (LLowerLeg (LFoot))))) ]] while true do s, e,…

Lua

○ 簡単 BNFは1ページちょい。 組み込み関数も少ない。 高速 JSは爪の垢を煎じて飲むべき。 function fib(n) return n < 2 and n or fib(n-1) + fib(n-2) end n, t = io.read'*n', os.clock() print('fib('.. n ..') = '.. fib(n) ..'\n'.. os.clock() - t .…