This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var e = (()=>{ | |
| var c = 0; | |
| return { | |
| a : ()=>c, | |
| b : (x)=>{c=x;} | |
| }; | |
| })(); | |
| var a = e.a; | |
| var b = e.b; | |
| console.log(a()); // => 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ------------------------------------------------------------------ | |
| // Usual Version | |
| // ------------------------------------------------------------------ | |
| var i = 0; | |
| var draw = function(xs){ | |
| console.log("Draw",i,":",xs); | |
| i++; | |
| }; | |
| var Mesh = function(v){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| struct Status{ | |
| int buf[256]; | |
| int pos; | |
| Status():pos(0){} | |
| Status add(){ | |
| buf[pos]++; | |
| return *this; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<iostream> | |
| #include<typeinfo> | |
| #include<cxxabi.h> | |
| template<int N> struct V{}; | |
| template<int N,class T> struct args{}; | |
| template<int M,int N> struct Var{}; | |
| template<bool N,class T> struct either{}; | |
| struct nu{}; | |
| template<class R,class T> struct lambda; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var W = World(function(transit){ | |
| var Title; | |
| var Game; | |
| Title = function(){ | |
| var h = {}; | |
| var x = 0; | |
| Input.listen(function(c){ | |
| if(c == Key.Enter)transit(Game(x)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Type = (function(){ | |
| var t = {}; | |
| function product(a,b){ | |
| var arr = []; | |
| for(var i=0;i<a.length;i++){ | |
| for(var j=0;j<b.length;j++){ | |
| arr.push(a[i]+b[j]); | |
| } | |
| } | |
| return arr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| line :: Proc String -- same as getLine | |
| solveB :: Proc String | |
| solveB = do | |
| [nS,vS,xS] <- words <$> line | |
| let | |
| n = read nS :: Int | |
| [v,x] = map read [vS,xS] :: [Double] | |
| ss <- map (map read . words) <$> replicateM n line | |
| let |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Data.Monoid | |
| import Data.List | |
| import Control.Applicative | |
| import Control.Monad | |
| import Control.Monad.State | |
| for :: [a] -> (a -> b) -> [b] | |
| for = flip map | |
| data Process i o a = Process { |
NewerOlder