Преглед на файлове

Notes on extra checks.

There's more then just 9x9 that ksudoku can generate,
so check for the other puzzles.
Steve Thielemann преди 11 месеца
родител
ревизия
7c91620e32
променени са 1 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 10 0
      sudoku/src/ksudoku.rs

+ 10 - 0
sudoku/src/ksudoku.rs

@@ -4,6 +4,7 @@ use std::io::BufReader;
 use xml::reader::{EventReader, XmlEvent};
 use xml::writer::XmlEvent as WrXmlEvent;
 use xml::EmitterConfig;
+use std::collections::HashMap;
 
 use std::error::Error;
 
@@ -24,6 +25,15 @@ pub fn load_ksudoku(filename: std::path::PathBuf) -> Result<String, Box<dyn Erro
                     // <graph specific-type="Plain" type="sudoku" order="9"/>
                     // Verify these are correct / not some other puzzle type!
 
+                    // This might be overkill here, I just need to verify Plain/sudoku/9...
+                    
+                    let mut attrs: HashMap<String, String> = HashMap::new();
+                    for a in attributes {
+                        attrs.insert(a.name.to_string(), a.value);
+                    }
+                    // {"specific-type": "Plain", "type": "sudoku", "order": "9"}
+
+                    println!("{:?}", attrs);
                 }
             }
             Ok(XmlEvent::Characters(text)) => {