예제 #1
0
 public override UInt64 Eval(Vars vars)
 {
     if (cond.Eval(vars) == 0)
     {
         return(trueExpr.Eval(vars));
     }
     else
     {
         return(falseExpr.Eval(vars));
     }
 }
예제 #2
0
파일: Fold.cs 프로젝트: xoposhiy/icfpc2013
        public override UInt64 Eval(Vars vars)
        {
            vars.foldAccumulator = Start.Eval(vars);
            var bytes = BitConverter.GetBytes(Collection.Eval(vars));

            foreach (var b in bytes)
            {
                vars.foldItem        = b;
                vars.foldAccumulator = Func.Eval(vars);
            }
            return(vars.foldAccumulator);
        }
예제 #3
0
        public void Eval(TestCase t)
        {
            var actual = Expr.Eval(t.Program, t.Arg);

            Assert.That(actual, Is.EqualTo(t.ExpectedValue), string.Format("Was: 0x{0:x}", actual));
        }