diff --git a/.github/workflows/test_on_pr.yml b/.github/workflows/test_on_pr.yml index 6ebf367..543d79f 100644 --- a/.github/workflows/test_on_pr.yml +++ b/.github/workflows/test_on_pr.yml @@ -14,7 +14,7 @@ jobs: args: "--target aarch64-apple-darwin" - platform: "macos-latest" # for Intel based macs. args: "--target x86_64-apple-darwin" - - platform: "ubuntu-20.04" # for Tauri v1 you could replace this with ubuntu-20.04. + - platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04. args: "" - platform: "windows-latest" args: "" @@ -35,7 +35,7 @@ jobs: targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-20.04' # This must match the platform value defined above. + if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf diff --git a/package.json b/package.json index 5bbf624..d7f67cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sudoxide", - "version": "0.2.0", + "version": "0.2.1", "private": true, "scripts": { "dev": "next dev", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index b4948f5..bb71ae5 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -275,9 +275,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" [[package]] name = "cesu8" @@ -363,18 +363,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "a9689a29b593160de5bc4aacab7b5d54fb52231de70122626c178e6a368994c7" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "2e5387378c84f6faa26890ebf9f0a92989f8873d4d380467bcd0d8d8620424df" dependencies = [ "anstyle", "clap_lex", @@ -382,9 +382,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "cocoa" @@ -566,31 +566,6 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" -[[package]] -name = "crossterm" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" -dependencies = [ - "bitflags 2.5.0", - "crossterm_winapi", - "libc", - "mio", - "parking_lot", - "signal-hook", - "signal-hook-mio", - "winapi", -] - -[[package]] -name = "crossterm_winapi" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" -dependencies = [ - "winapi", -] - [[package]] name = "crunchy" version = "0.2.2" @@ -747,9 +722,9 @@ checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dtoa-short" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" dependencies = [ "dtoa", ] @@ -775,7 +750,7 @@ dependencies = [ "cc", "memchr", "rustc_version", - "toml 0.8.13", + "toml 0.8.14", "vswhom", "winreg 0.52.0", ] @@ -1406,9 +1381,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -1825,7 +1800,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] @@ -2922,36 +2896,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-mio" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" -dependencies = [ - "libc", - "mio", - "signal-hook", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - [[package]] name = "simd-adler32" version = "0.3.7" @@ -3067,10 +3011,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "sudoku" version = "0.1.0" -source = "git+https://github.com/Nervonment/sudoku.git#7ae71a070820d2ce50f76df7e39f0f96b872b67b" +source = "git+https://github.com/Nervonment/sudoku.git#793bb8e9bdcab7bde360dac4eb57b3c411a9507c" dependencies = [ "criterion", - "crossterm", "rand 0.8.5", ] @@ -3145,7 +3088,7 @@ dependencies = [ "cfg-expr 0.15.8", "heck 0.5.0", "pkg-config", - "toml 0.8.13", + "toml 0.8.14", "version-compare 0.2.0", ] @@ -3209,9 +3152,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" dependencies = [ "filetime", "libc", @@ -3226,9 +3169,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tauri" -version = "1.6.7" +version = "1.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c7177b6be45bbb875aa239578f5adc982a1b3d5ea5b315ccd100aeb0043374" +checksum = "77567d2b3b74de4588d544147142d02297f3eaa171a25a065252141d8597a516" dependencies = [ "anyhow", "base64 0.21.7", @@ -3595,14 +3538,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.13", + "toml_edit 0.22.14", ] [[package]] @@ -3629,15 +3572,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.9", + "winnow 0.6.13", ] [[package]] @@ -4355,9 +4298,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.9" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 6c3e1cb..4f1d652 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1,17 +1,14 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] -use std::sync::{Arc, Mutex}; - use serde::Serialize; +use std::sync::{Arc, Mutex}; use sudoku::{ - game::generator::random_sudoku_puzzle_phishing, - neo::{ - generator::random_sudoku_puzzle, - judge::judge_sudoku as judge, - puzzle::{SudokuPuzzleFull, SudokuPuzzleSimple}, - solver::{StochasticSolver, TechniquesSolver}, + generator::{ + random_sudoku_puzzle_easy, random_sudoku_puzzle_extraeasy, random_sudoku_puzzle_extrahard, + random_sudoku_puzzle_hard, random_sudoku_puzzle_normal, random_sudoku_puzzle_ultimate, }, + judge::judge_sudoku as judge, }; use tauri::State; @@ -52,33 +49,18 @@ struct SettingsState(Arc>); async fn get_sudoku_puzzle(settings: State<'_, SettingsState>) -> Result<[[i8; 9]; 9], ()> { let difficulty = settings.0.lock().unwrap().difficulty; Ok(match difficulty { - 0 => random_sudoku_puzzle::< - StochasticSolver, - TechniquesSolver, - >(30, 0, 50), - 1 => random_sudoku_puzzle::< - StochasticSolver, - TechniquesSolver, - >(50, 50, 90), - 2 => random_sudoku_puzzle::< - StochasticSolver, - TechniquesSolver, - >(55, 90, 200), - 3 => random_sudoku_puzzle::< - StochasticSolver, - TechniquesSolver, - >(50, 200, 1000), - 4 => random_sudoku_puzzle::< - StochasticSolver, - TechniquesSolver, - >(45, 800, 10000), - _ => random_sudoku_puzzle_phishing(), + 0 => random_sudoku_puzzle_extraeasy().0, + 1 => random_sudoku_puzzle_easy().0, + 2 => random_sudoku_puzzle_normal().0, + 3 => random_sudoku_puzzle_hard().0, + 4 => random_sudoku_puzzle_extrahard().0, + _ => random_sudoku_puzzle_ultimate().0, }) } #[tauri::command] async fn judge_sudoku(board: [[i8; 9]; 9]) -> (bool, [[bool; 9]; 9]) { - let res = judge(&board); + let res = judge(&sudoku::Grid(board)); (res.1, res.2) } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 3ac6f5f..b9b555a 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "Sudoxide", - "version": "0.2.0" + "version": "0.2.1" }, "tauri": { "allowlist": { @@ -65,7 +65,7 @@ "updater": { "active": true, "endpoints": [ - "https://nervonment.github.io/sudoxide/versions/update.json" + "https://nervonment.github.io/sudoxide_versions/update.json" ], "dialog": true, "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDQyNEU5RDgyQjQxODE2NDkKUldSSkZoaTBncDFPUW9KdEtMMTRsUVptUG9BUGtDUXdnd0QwdkRoays2YkZLVjdBWG1LODlmNVEK", diff --git a/versions/update.json b/versions/update.json deleted file mode 100644 index e11235e..0000000 --- a/versions/update.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "0.2.0", - "notes": "See the assets to download this version and install.", - "pub_date": "2024-06-05T16:26:48.418Z", - "platforms": { - "darwin-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSSkZoaTBncDFPUXNkYmZzRWpkS2p6eG5kYmUvK3c3VHVKZTNyTlJjQVBhTXpFb0R1ZTZFd2xYYlpMRTdkY21LQS9SK0dJNHVTd2UxYTM5cVVSdDJhKzVzWkpCeXlSZVEwPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzE3NjA0NDUxCWZpbGU6U3Vkb3hpZGUuYXBwLnRhci5negpGaUU1MkpPYjl1SU9rdHNtZzMwVy9kcmdWZjJlYncrWWVTZVdOem1JRXQwMzlXdGVzT2YzUUNoTlZoWnVNY1lnQTQwVnI1cTFGNVlUMzZpS0RZd05BZz09Cg==", - "url": "https://github.com/Nervonment/sudoxide/releases/download/v0.2.0/Sudoxide_x64.app.tar.gz" - }, - "darwin-aarch64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSSkZoaTBncDFPUWd0eDR2ZkY0YWhYU2JnSnVKdThQdEdoVUhTQ3lxd2ZhWFhDNWpYUzdGZGk1NUh0dVVPVFhCNFdSbXozU3FQQkROMU1NdlVFWE1zRXBFNFpzWXduY2dNPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzE3NjA0NTE0CWZpbGU6U3Vkb3hpZGUuYXBwLnRhci5negpaUkh0QjZUbmFKWmcxaGFKdVR3dmV0eXcycU84QWc4Q3EyMXkxVmhnYnZNMzRkY3ArTXV2YVhQbFBKeVdyRENld1lQSFJtdE5Rb0tjM1c1MVA3Z3dEdz09Cg==", - "url": "https://github.com/Nervonment/sudoxide/releases/download/v0.2.0/Sudoxide_aarch64.app.tar.gz" - }, - "linux-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSSkZoaTBncDFPUWlMWjlEY2luUXJKR0pBQWUxNmRGeG56UnhFYmY0VEFSQU9UbUVndVgxVVBubnE0ZTloT1FtTmlWMUYzQWVNUGNuZ1NnWG1wSm10TkdZV2tscTZidEFRPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzE3NjA0NjcxCWZpbGU6c3Vkb3hpZGVfMC4yLjBfYW1kNjQuQXBwSW1hZ2UudGFyLmd6CnRCVHFwVHhReWdUUmlSMVdnWUFsR3haM0JmWVlKdlBScW8yY3Y5WFlaMTFRbVUyelMrL2Y2NmxBMlVRamNkb3dNR1g0ZWo4SHQ4L05kZ1FjczBhYkFBPT0K", - "url": "https://github.com/Nervonment/sudoxide/releases/download/v0.2.0/sudoxide_0.2.0_amd64.AppImage.tar.gz" - }, - "windows-x86_64": { - "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSSkZoaTBncDFPUWt2UTRVRnRkREZDZlgyR2UrTlMwbHowbXFndll4VXorclV6dVlEUTdKaHRSRDNTdW83K3lRZzFkdURudXBGV016OTZoaXZFMGVqQ2NpYTZKd0VkTFFFPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzE3NjA0ODAyCWZpbGU6U3Vkb3hpZGVfMC4yLjBfeDY0X3poLUNOLm1zaS56aXAKSlE3aTU1MFBnM1U1TmdWSGV4Q3RCb0p6QXFyTy91Wm1udnNiQmRtbUFKaEpmVzlTeGFJY1hNMGRjaTlLbmNSdWROMXRqTG5vTWlhS2JUeHN5eUkxQ3c9PQo=", - "url": "https://github.com/Nervonment/sudoxide/releases/download/v0.2.0/Sudoxide_0.2.0_x64_en-US.msi.zip" - } - } -}