Exemple #1
0
        public void CreateNewHyperspace(int numTestCases, int numBombs, string hyperspaceFileFullPath)
        {
            if (numTestCases <= 0 || numBombs <= 0)
            {
                return;
            }
            Random rand   = new Random();
            var    stream = File.CreateText(hyperspaceFileFullPath);

            stream.WriteLine(numTestCases);
            for (int i = 0; i < numTestCases; i++)
            {
                stream.Write(numBombs);
                for (int j = 0; j < numBombs; j++)
                {
                    var point = new int[3];
                    for (int k = 0; k < 3; k++)
                    {
                        stream.Write(",");
                        var nextRand = rand.Next(0, 1000);
                        stream.Write(nextRand);
                        point[k] = nextRand;
                    }
                    if (i == 0)
                    {
                        exampleHtmlSceneBuilder.AddBomb(point);
                    }
                }
                stream.WriteLine();
            }
            stream.Close();
        }