mirror of https://github.com/dnomd343/klotski.git
Dnomd343
2 years ago
3 changed files with 63 additions and 36 deletions
@ -0,0 +1,16 @@ |
|||||
|
use super::ffi as codec_ffi; |
||||
|
|
||||
|
#[derive(Debug)] |
||||
|
pub struct CommonCode { |
||||
|
code: u64 |
||||
|
} |
||||
|
|
||||
|
impl CommonCode { |
||||
|
|
||||
|
pub(crate) fn new(common_code: u64) -> CommonCode { |
||||
|
CommonCode { |
||||
|
code: common_code |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -1,4 +1,21 @@ |
|||||
mod ffi; |
mod ffi; |
||||
mod short_code; |
mod short_code; |
||||
|
mod common_code; |
||||
|
|
||||
pub use short_code::demo; |
use short_code::ShortCode; |
||||
|
use common_code::CommonCode; |
||||
|
|
||||
|
pub fn demo() { |
||||
|
let s = ShortCode::from(12345678).unwrap(); |
||||
|
println!("{:?}", s); |
||||
|
println!("{}", s); |
||||
|
println!("{}", s.to_string()); |
||||
|
|
||||
|
let s = ShortCode::from_str("CSSBF").unwrap(); |
||||
|
println!("{}", s.unwrap()); |
||||
|
|
||||
|
println!("ShortCode warm up"); |
||||
|
ShortCode::warm_up(); |
||||
|
println!("ShortCode warm up fast"); |
||||
|
ShortCode::warm_up_fast(); |
||||
|
} |
||||
|
Loading…
Reference in new issue