Skip to content

Commit

Permalink
修改审录像逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
eee555 committed Jul 28, 2024
1 parent ceb84ec commit 25f8ef8
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Algorithms for minesweeper, published on various platforms.

python>=3.7, <=3.10 (适用于以下架构windows: x86, x64; linux: aarch64, armv7, ppc64le, s390x, x86, x86_64; macos: aarch64, x86_64): 1.4.10

javascript/typescript (webpack等bundler): 1.4.6-alpha
javascript/typescript (webpack等bundler): 1.4.7

javascript/typescript (nodejs): 1.4.0-alpha

Expand Down
2 changes: 1 addition & 1 deletion base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ authors = ["Wang Jianing <wangjianing@88.com>"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["rs"]
default = ["js"]
js = ["getrandom", "web-sys"]
py = ["rand", "tract-onnx"]
rs = ["rand", "tract-onnx"]
Expand Down
4 changes: 2 additions & 2 deletions base/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,13 @@ pub trait js_shuffle {
}

#[cfg(feature = "js")]
impl<T> js_shuffle for Vec<T> {
impl js_shuffle for Vec<i32> {
fn shuffle_(&mut self) {
// 存疑!!!!!
let l = self.len();
for i in 1..l {
let id = get_random_int(i + 1);
let t = self[i].clone();
let t = self[i];
self[i] = self[id];
self[id] = t;
}
Expand Down
9 changes: 5 additions & 4 deletions base/src/videos/base_video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,10 @@ impl BaseVideo<SafeBoard> {
}
}
GameBoardState::Playing => {
if self.mode != 9 && self.mode != 10 {
return Err(());
}
// 不再限制模式,以防过于严格。
// if self.mode != 6 && self.mode != 7 && self.mode != 8 && self.mode != 9 && self.mode != 10 {
// return Err(());
// }
if self.width != board[0].len() || self.height != board.len() {
return Err(());
}
Expand Down Expand Up @@ -2262,7 +2263,7 @@ impl<T> BaseVideo<T> {
return 1;
}
} else if self.software == "元3.2".as_bytes().to_vec()
|| self.software == "元3.1.7".as_bytes().to_vec()
|| self.software == "元3.1.9".as_bytes().to_vec()
{
if self.checksum.iter().all(|&e| e == self.checksum[0]) {
// 大概率是使用了测试用的校验和
Expand Down
2 changes: 1 addition & 1 deletion wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ms-toollib"
version = "1.4.6-alpha"
version = "1.4.7"
authors = ["eee555 <50390200+eee555@users.noreply.github.com>"]
edition = "2021"
homepage = "https://github.com/eee555/ms-toollib"
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ macro_rules! generate_video {
self.core.data.is_completed
}
#[wasm_bindgen(getter)]
pub fn get_is_offical(&self) -> bool {
self.core.data.is_offical
pub fn get_is_official(&self) -> bool {
self.core.data.is_official
}
#[wasm_bindgen(getter)]
pub fn get_is_fair(&self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion wasm/www/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ request.onload = () => {
console.log(video.events_x(i), video.events_y(i), video.events_mouse(i));
}
console.log(video.get_is_fair);
console.log(video.get_is_offical);
console.log(video.get_is_official);
console.log(video.get_is_completed);
console.log(video.is_valid());
}
Expand Down

0 comments on commit 25f8ef8

Please sign in to comment.