Exemple #1
0
        public IReadOnlyCollection <Coords> GenerateMineLocations(int numRows, int numCols, int numMines)
        {
            var allCoords =
                from row in Enumerable.Range(0, numRows)
                from col in Enumerable.Range(0, numCols)
                select new Coords(row, col);

            var generator = GenExtensions.PickValues(numMines, allCoords);

            return(Gen.sample(0, 1, generator).Head);
        }
        public void Sample()
        {
            var twoStrings = GenExtensions.PickValues(2, "red", "blue", "green", "pink");

            twoStrings.DumpSamples(Formatters.FormatCollection);
        }