1999-08-01から1日間の記事一覧
<html> <head> <title>Turtle Monad</title> <script src="TurtleMonad.js" ></script> <script> var _canvas = null; var _ctx = null; function initCanvas() { _canvas = document.getElementById("canvas"); _ctx = _canvas.getContext('2d'); } </script> <style> #canvas {border: 1px sol…</head></html>
/* CyclicCounterMonad.js */ // オペレーション・モノイド var CounterOp = { // モノイド単位 unit : function() { return 0; }, // モノイド乗法 mult : function(x, y) { return x + y; } }; // カウンター・オブジェクト(シングルトン) var Counter =…
<html> <head> <title>Counter Monad</title> <script src="CounterMonad.js" ></script> </head> <body> <h1>Counter Monad</h1> </body> </html> /* CounterMonad.js */ // オペレーション・モノイド var CounterOp = { // 定数 UP : 117, // 'u' = upオペレーション DOWN : 100, // 'd' = downオペレーション // モノイド単位 u…