generated from PlexSheep/rs-base
automatic cargo CI changes
cargo devel CI / cargo CI (push) Successful in 1m36s
Details
cargo devel CI / cargo CI (push) Successful in 1m36s
Details
This commit is contained in:
parent
3b0eec9032
commit
5f32f8227f
|
@ -1,12 +1,7 @@
|
||||||
use chrono::{self, Duration, NaiveDateTime, NaiveTime, TimeDelta};
|
use chrono::{self, NaiveDateTime, TimeDelta};
|
||||||
use core::panic;
|
|
||||||
use libpt::log::debug;
|
use libpt::log::debug;
|
||||||
use std::fmt::Display;
|
|
||||||
use std::ops::Div;
|
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
|
use std::fmt::Display;
|
||||||
#[cfg(feature = "serde")]
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
|
|
||||||
use crate::game::response::GuessResponse;
|
use crate::game::response::GuessResponse;
|
||||||
use crate::game::Game;
|
use crate::game::Game;
|
||||||
|
|
|
@ -8,9 +8,7 @@ use clap::Parser;
|
||||||
use libpt::log::*;
|
use libpt::log::*;
|
||||||
|
|
||||||
use wordle_analyzer::bench::builtin::BuiltinBenchmark;
|
use wordle_analyzer::bench::builtin::BuiltinBenchmark;
|
||||||
use wordle_analyzer::bench::report::Report;
|
|
||||||
use wordle_analyzer::bench::{Benchmark, DEFAULT_N};
|
use wordle_analyzer::bench::{Benchmark, DEFAULT_N};
|
||||||
use wordle_analyzer::error::WResult;
|
|
||||||
use wordle_analyzer::game::GameBuilder;
|
use wordle_analyzer::game::GameBuilder;
|
||||||
use wordle_analyzer::solve::{AnyBuiltinSolver, BuiltinSolverNames, Solver};
|
use wordle_analyzer::solve::{AnyBuiltinSolver, BuiltinSolverNames, Solver};
|
||||||
use wordle_analyzer::wlist::builtin::BuiltinWList;
|
use wordle_analyzer::wlist::builtin::BuiltinWList;
|
||||||
|
|
|
@ -51,5 +51,5 @@ pub enum GameError {
|
||||||
#[derive(Debug, Clone, Error)]
|
#[derive(Debug, Clone, Error)]
|
||||||
pub enum BenchError {
|
pub enum BenchError {
|
||||||
#[error("Trying to modify a finished report")]
|
#[error("Trying to modify a finished report")]
|
||||||
ModifyFinishedReport
|
ModifyFinishedReport,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::error::*;
|
use crate::error::*;
|
||||||
use crate::wlist::word::{ManyWordDatas, ManyWordsRef, Word, WordData};
|
use crate::wlist::word::{ManyWordsRef, Word, WordData};
|
||||||
use crate::wlist::WordList;
|
use crate::wlist::WordList;
|
||||||
|
|
||||||
use libpt::log::{debug, trace};
|
use libpt::log::{debug, trace};
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
use crate::wlist::word::{Word, WordData};
|
use crate::wlist::word::{Word, WordData};
|
||||||
use crate::wlist::WordList;
|
use crate::wlist::WordList;
|
||||||
use anyhow::Ok;
|
use colored::Colorize;
|
||||||
use colored::{ColoredString, Colorize};
|
|
||||||
use libpt::log::debug;
|
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
|
|
|
@ -6,6 +6,12 @@ pub struct Summary<'wl, WL: WordList> {
|
||||||
data: Vec<&'wl Game<'wl, WL>>,
|
data: Vec<&'wl Game<'wl, WL>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'wl, WL: WordList> Default for Summary<'wl, WL> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'wl, WL: WordList> Summary<'wl, WL> {
|
impl<'wl, WL: WordList> Summary<'wl, WL> {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self { data: Vec::new() }
|
Self { data: Vec::new() }
|
||||||
|
|
|
@ -2,7 +2,7 @@ use std::{fmt::Display, str::FromStr};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
error::{Error, WResult},
|
error::{Error, WResult},
|
||||||
game::{response::*, summary::Summary, Game},
|
game::{response::*, Game},
|
||||||
wlist::{
|
wlist::{
|
||||||
word::{Word, WordData},
|
word::{Word, WordData},
|
||||||
WordList,
|
WordList,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use libpt::log::{debug, info, trace};
|
use libpt::log::{info, trace};
|
||||||
|
|
||||||
use crate::wlist::word::{ManyWordDatas, Word};
|
use crate::wlist::word::{ManyWordDatas, Word};
|
||||||
use crate::wlist::WordList;
|
use crate::wlist::WordList;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use libpt::log::debug;
|
|
||||||
use rand::seq::IteratorRandom;
|
use rand::seq::IteratorRandom;
|
||||||
|
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
@ -71,7 +70,7 @@ pub trait WordList: Clone + std::fmt::Debug + Default + Sync {
|
||||||
fn raw_wordlist(&self) -> String {
|
fn raw_wordlist(&self) -> String {
|
||||||
let mut buf = String::new();
|
let mut buf = String::new();
|
||||||
for w in self.wordmap().keys() {
|
for w in self.wordmap().keys() {
|
||||||
buf += &w;
|
buf += w;
|
||||||
buf += "\n";
|
buf += "\n";
|
||||||
}
|
}
|
||||||
buf
|
buf
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt::write;
|
use std::fmt::write;
|
||||||
use std::hash::Hash;
|
|
||||||
|
|
||||||
use libpt::log::{debug, trace};
|
use libpt::log::trace;
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
@ -21,6 +20,12 @@ pub struct WordMap {
|
||||||
inner: HashMap<Word, Frequency>,
|
inner: HashMap<Word, Frequency>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for WordMap {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl WordMap {
|
impl WordMap {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
@ -68,10 +73,9 @@ impl WordMap {
|
||||||
&self.inner
|
&self.inner
|
||||||
}
|
}
|
||||||
pub fn get<I: std::fmt::Display>(&self, word: I) -> Option<WordData> {
|
pub fn get<I: std::fmt::Display>(&self, word: I) -> Option<WordData> {
|
||||||
match self.inner.get(&word.to_string()) {
|
self.inner
|
||||||
Some(f) => Some((word.to_string(), *f)),
|
.get(&word.to_string())
|
||||||
None => None,
|
.map(|f| (word.to_string(), *f))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
pub fn from_absolute(abs: HashMap<Word, usize>) -> Self {
|
pub fn from_absolute(abs: HashMap<Word, usize>) -> Self {
|
||||||
let n: f64 = abs.keys().len() as f64;
|
let n: f64 = abs.keys().len() as f64;
|
||||||
|
|
Loading…
Reference in New Issue