示例#1
0
        static void Main(string[] args)
        {
            Console.Title = "TIS-100";

            Simple.Run();

            Doubler.Run();

            Sorter.Run();

            Console.ReadLine();
        }
示例#2
0
 public IActionResult Doubling(double?input)
 {
     if (input != null)
     {
         var db = new Doubler(input);
         return(new JsonResult(db));
     }
     else
     {
         var doublerError = new ErrorMsg("an input");
         return(new JsonResult(doublerError));
     }
 }
示例#3
0
            public void Run()
            {
                int first  = 15;
                int second = 10;

                Console.WriteLine("Before doubling:");
                Console.WriteLine("First number: {0}, Second number: {1}",
                                  first, second);
                Doubler d = new Doubler();

                d.DoubleInt(first, out second);
                Console.WriteLine("After doubling:");
                Console.WriteLine("First number: {0}, Second number: {1}",
                                  first, second);
            }
示例#4
0
 private void btnStartGame_Click(object sender, EventArgs e)
 {
     newGame                   = new Doubler(rnd.Next(20, 10001));
     counter                   = 0;
     lblCounter.Text           = String.Empty;
     lblResult.Text            = String.Empty;
     lblCurentNumber.ForeColor = Color.Black;
     lblRequiredNumber.Text    = newGame.Finish.ToString();
     lblCurentNumber.Text      = newGame.Current.ToString();
     btnIncrement.Enabled      = true;
     btnDouble.Enabled         = true;
     btnReset.Enabled          = true;
     btnStartGame.Enabled      = false;
     menuStartGame.Enabled     = false;
     stepList.Insert(counter, newGame.Current.ToString());
 }
        static void Main(string[] args)
        {
            Doubler   S = new Doubler();
            IsPair    I = new IsPair();
            Factorial F = new Factorial();

            int[] valuesS = { 1, 2, 3, 4, 5 };
            int[] valuesI = { 1, 2, 3, 4, 5 };
            int[] valuesF = { 1, 2, 3, 4, 5 };

            Util.TransformAll(valuesS, S);

            Util.TransformAll(valuesI, I);

            Util.TransformAll(valuesF, F);

            Console.ReadKey(false);
        }
示例#6
0
        //static bool exit;
        static void Main()
        {
            AccountManager.Main();
            while (!SepoHelper.exit)
            {
                Console.Clear();
                switch (SelectTask())
                {
                case 0:
                    SepoHelper.exit = true;
                    ExitProg();
                    break;

                case 1:
                    Task_1.Main();
                    break;

                case 2:
                    MyArray.Main();
                    break;

                case 3:
                    AccountManager.Main();
                    break;

                case 4:
                    MyMultiArray.Main();
                    break;

                case 5:
                    Doubler.Main();
                    break;

                case 6:
                    TrueOrNotTrue.Main();
                    break;
                }
            }
            //ExitProg();
        }
示例#7
0
                public Logic(Doubler <T> stage) : base(stage.Shape)
                {
                    // Called when the output port has received a pull, and therefore ready to emit an element, i.e. GraphStageLogic.Push()
                    // is now allowed to be called on this port.
                    SetHandler(stage.Shape.Outlet, onPull: () =>
                    {
                        if (_oneMore)
                        {
                            Push(stage.Shape.Outlet, _latest);
                            _oneMore = false;
                        }
                        else
                        {
                            Pull(stage.Shape.Inlet);
                        }
                    });

                    SetHandler(stage.Shape.Inlet, onPush: () =>
                    {
                        _latest  = Grab(stage.Shape.Inlet);
                        _oneMore = true;
                        Push(stage.Shape.Outlet, _latest);
                    });
                }
示例#8
0
 public void DoublerTest()
 {
     Assert.That(Doubler.Double(2), Is.EqualTo(4));
 }