mirror of https://github.com/dnomd343/klotski.git
Dnomd343
2 years ago
6 changed files with 66 additions and 2 deletions
@ -0,0 +1,52 @@ |
|||
use crate::core::Core; |
|||
|
|||
lazy_static! { |
|||
static ref BASIC_RANGES: Vec<u32> = { |
|||
unsafe { |
|||
Core::basic_ranges_build(); |
|||
let mut buffer: Vec<u32> = vec![0; Core::BASIC_RANGES_SIZE as usize]; |
|||
Core::export_basic_ranges(&mut buffer[0]); |
|||
buffer |
|||
} |
|||
}; |
|||
} |
|||
|
|||
// struct BasicRange {
|
|||
// data: Option<Vec<u32>>
|
|||
// }
|
|||
//
|
|||
// static mut BASIC_RANGE: BasicRange = BasicRange {
|
|||
// data: None
|
|||
// };
|
|||
|
|||
// impl BasicRange {
|
|||
// fn fetch(&mut self) -> &Vec<u32> {
|
|||
// match &self.data {
|
|||
// Some(data) => {
|
|||
// return data;
|
|||
// },
|
|||
// None => (),
|
|||
// };
|
|||
|
|||
// &self.data.unwrap()
|
|||
// }
|
|||
|
|||
// fn build(&mut self) {
|
|||
// unsafe {
|
|||
// Core::basic_ranges_build();
|
|||
// let mut buffer: Vec<u32> = vec![0; Core::BASIC_RANGES_SIZE as usize];
|
|||
// Core::export_basic_ranges(&mut buffer[0]);
|
|||
// self.data = Some(buffer);
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
|
|||
pub fn demo() { |
|||
|
|||
println!("demo start"); |
|||
|
|||
println!("{:?}", (*BASIC_RANGES).len()); |
|||
|
|||
println!("demo complete"); |
|||
|
|||
} |
@ -1,9 +1,15 @@ |
|||
#[macro_use] |
|||
extern crate lazy_static; |
|||
|
|||
mod core; |
|||
mod codec; |
|||
mod metadata; |
|||
mod all_cases; |
|||
|
|||
pub use codec::RawCode; |
|||
pub use codec::ShortCode; |
|||
pub use codec::CommonCode; |
|||
|
|||
pub use metadata::load_metadata as metadata; |
|||
|
|||
pub use all_cases::demo; |
|||
|
Loading…
Reference in new issue