コード例 #1
0
        public void TestMethodBackward()
        {
            List<int> testtape = new List<int>
                {
                    0
                };

            BrainMessInterpreter obj = new BrainMessInterpreter { tape = testtape, tapeHead =1 };
            obj.Backward();
            Assert.AreEqual(obj.tapeHead, 0);
        }
コード例 #2
0
        public void TestMethodIncrement()
        {
            List<int> testtape= new List<int>
                 {
                     0
                 };
            const int testtapeHead = 0;

               BrainMessInterpreter obj= new BrainMessInterpreter {tape = testtape,tapeHead = testtapeHead};
            obj.Increment();
            Assert.AreEqual( testtape[0],1);
        }
コード例 #3
0
        public void TestMethodForward()
        {
            List<int> testtape = new List<int>
                {
                    0
                };
            const int testtapeHead = 0;

            BrainMessInterpreter obj = new BrainMessInterpreter { tape = testtape, tapeHead = testtapeHead };
            obj.Forward();
            Assert.AreEqual(testtape.Count, 2);
        }
コード例 #4
0
 static void Main()
 {
     string phrase = Console.ReadLine();
     BrainMessInterpreter objbrainmess = new BrainMessInterpreter();
     objbrainmess.Interprate(phrase);
     Console.ReadLine();
 }