Prechádzať zdrojové kódy

Use GenBits<u32>. We failed on 25 puzzle.

Bugz 4 mesiacov pred
rodič
commit
5289dd24ee
1 zmenil súbory, kde vykonal 3 pridanie a 2 odobranie
  1. 3 2
      sudoku/src/sudoku.rs

+ 3 - 2
sudoku/src/sudoku.rs

@@ -955,7 +955,8 @@ impl AnySolver {
 
                 found_something = false;
 
-                let mut values = Bits(0); // HashSet<u8> = HashSet::new();
+                // let mut values = Bits(0); // HashSet<u8> = HashSet::new();
+                let mut values = GenBits::<u32>(0);
 
                 let mut group_process = |this: &mut Self, grp: &[usize]| {
                     // Collect all the possible values within the group.
@@ -963,7 +964,7 @@ impl AnySolver {
                     for gidx in 0..width {
                         // println!("possible: {:?}", this.possible[grp.items[gidx as usize] as usize]);
                         for v in this.possible.possible[grp[gidx as usize]].iter() {
-                            values.set(v, true);
+                            values.set(v as usize, true);
                         }
                         // values.extend(this.possible[grp.0[gidx as usize] as usize]);
                         // println!("now     : {:?}", this.possible[grp.items[gidx as usize] as usize]);