示例#1
0
 bool AllKeysEqual(PermutationKey key)
 {
     for (var i = 0; i < 10; i++) {
         if (key[i] != this[i]) return false;
     }
     return true;
 }
示例#2
0
 static bool AllKeysZero(PermutationKey key)
 {
     for (var i = 0; i < 10; i++) {
         if (key[i] != 0) return false;
     }
     return true;
 }
示例#3
0
 public static PermutationKey CreateKey(long i)
 {
     var key = new PermutationKey();
     var iStr = i.ToString();
     foreach (var index in iStr.Select(ch => int.Parse(ch.ToString()))) {
         key[index] = key[index] + 1;
     }
     return key;
 }