예제 #1
0
        public void SolveChallenge_ShouldSolveChallengeInputs()
        {
            string        inputText = Properties.Resources.challenge4;
            List <string> ciphers   = inputText.Split(new[] { "\n" }, StringSplitOptions.None).ToList();
            string        expected  = "7b5a4215415d544115415d5015455447414c155c46155f4058455c5b523f";

            string actual = new Challenge4(ciphers, new VigenereCrack()).SolveChallenge();

            Assert.Equal(expected, actual);
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Challenge 1");
            Console.Write(Environment.NewLine);
            //int[] arr = new int[5] { 2, 2, 2, 2, 2 };
            //Console.WriteLine($"[{arr[0]},{arr[1]},{arr[2]},{arr[3]},{arr[4]}]");
            Console.WriteLine($"Final Score: {Challenge1.Grade(Challenge1.CheckArray(), Challenge1.ChooseNumber())}");
            Console.Write(Environment.NewLine);

            Console.WriteLine("Challenge 2");
            Console.Write(Environment.NewLine);
            Console.WriteLine(Challenge2.LeapYear());
            Console.Write(Environment.NewLine);

            Console.WriteLine("Challenge 3");
            Console.Write(Environment.NewLine);
            int[] test = new int[3] {
                1, 3, 2
            };
            Console.WriteLine(Challenge3.CheckSequence(test));
            Console.Write(Environment.NewLine);

            Console.WriteLine("Challenge 4");
            Console.Write(Environment.NewLine);
            int[,] myArray = new int[3, 5] {
                { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10 }, { 11, 12, 13, 14, 15 }
            };
            for (int x = 0; x < myArray.GetLength(0); x++)
            {
                Console.Write("[");
                for (int i = 0; i < myArray.GetLength(1); i++)
                {
                    Console.Write(string.Format("{0}", myArray[x, i]));
                    if (i < myArray.GetLength(1) - 1)
                    {
                        Console.Write(",");
                    }
                }
                Console.Write("]");
                Console.Write(Environment.NewLine);
            }
            Console.Write(Environment.NewLine);
            Console.WriteLine("Sum of Each Row");
            Console.WriteLine("[" + string.Join(",", Challenge4.RowSum(myArray)) + "]");
        }
예제 #3
0
        public void GetBestGuessSingleByteEncryptedHex_ValidData_CorrectEncryptedHex()
        {
            var bestGuess = Challenge4.GetBestGuessSingleByteEncryptedHex(Challenge4Data.Data);

            Assert.Equal("7b5a4215415d544115415d5015455447414c155c46155f4058455c5b523f", bestGuess.Hex);
        }
예제 #4
0
 public void GetBestGuessSingleByteEncryptedHex_NullData_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => Challenge4.GetBestGuessSingleByteEncryptedHex(null));
 }
    void Start()
    {
        this._wasHacked = false;
        this._wasActivatedSpawn = false;

        this._timeToSpawn = SPAWNTIME;
        this._totalSpawn = 0;

        this._screenTransform = transform.FindChild("Screen");
        this._lightObject = transform.FindChild("Light").GetComponent<Light>();

        this._enemyObject = (GameObject)Resources.Load("Enemies/HumanoidRed");
        this._spawnTransform = transform.FindChild("Spawn");

        this._alarmMaterial = (Material)Resources.Load("Computer/Alarm");
        this._hackedMaterial = (Material)Resources.Load("Computer/Hacked");
        this._desactivatedMaterial = (Material)Resources.Load("Computer/Desactivated");

        GameObject aux = GameObject.Find("Level");
        this._challengeRing = aux.transform.GetComponent<Challenge3>();
        this._challengeFinal = gameObject.transform.GetComponent<Challenge4>();
        //Debug.Log("4: " + this._challengeFinal);

        this.ChangeTextureAndLight(this._desactivatedMaterial, Color.yellow);
    }