public void Run()
        {
            var cc   = ConcealedCombinationCreator.ForSuits();
            var sc   = new SuitClassifier();
            var dict = new Dictionary <int, int>();

            for (var i = 0; i < 15; i++)
            {
                var combinations = cc.Create(i);
                foreach (var combination in combinations)
                {
                    var c  = combination.Counts.Select(x => (byte)x).ToArray();
                    var rc = c.Reverse().ToArray();

                    var h1 = Hash(c);
                    var a1 = sc.GetValue(c, 0, new [] { h1 });
                    AddToDictionary(dict, h1, a1);

                    var h2 = Hash(rc);
                    var a2 = sc.GetValue(rc, 0, new[] { h1 });
                    AddToDictionary(dict, h2, a2);
                }
            }

            var max  = dict.Keys.Max();
            var data = new byte[max + 1];

            foreach (var p in dict)
            {
                data[p.Key] = (byte)p.Value;
            }

            using var f = File.OpenWrite(@"C:\Shanten2\suitArrangementsBase5NoMelds.dat");
            f.Write(data);
        }
Exemplo n.º 2
0
        static Hash()
        {
            var cc = ConcealedCombinationCreator.ForSuits();

            for (var i = 0; i < 15; i++)
            {
                var combinations = cc.Create(i);
                foreach (var combination in combinations)
                {
                    var c = combination.Counts.ToArray();
                    _data.Add(c);
                }
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Returns a ConcealedCombinationCreator.
 /// </summary>
 /// <returns>An instance of ConcealedCombinationCreator.</returns>
 protected override ConcealedCombinationCreator GetConcealedCombinationCreator()
 {
     return(ConcealedCombinationCreator.ForSuits());
 }