///Creates a bucket for a given word given
///a bank of guesses and possible solutions.
///Note I only let buckets be composed of possible solution words.
///All compare functions require a solution word though not all will use it in which case it is
///fine ot just put in whatever.
Creates a bucket for a given word given
a bank of guesses and possible solutions.
Note I only let buckets be composed of possible solution words.
All compare functions require a solution word though not all will use it in which case it is
fine ot just put in whatever.
Creates a bucket for a given word given a bank of guesses and possible solutions . Note I only let buckets be composed of possible solution words . All compare functions require a solution word though not all will use it in which case it is fine ot just put in whatever .
fn bucket<T>(
    guess: WordId,
    solution: WordId,
    compare: T,
    left: &[WordId],
    gbank: WordBank,
    sbank: WordBank,
) -> Bucket
where
    T: Fn(WordId, WordId, WordBank, WordBank) -> Grade,
{
    let guess_mark = compare(guess, solution, gbank, sbank);
    let mut bkt = vec![];
    for &word in left {
        let wmark = compare(guess, word, gbank, sbank);
        if wmark == guess_mark {
            bkt.push(word);
        }
    }
    bkt
}
fn bucket < T > ( guess : WordId , solution : WordId , compare : T , left : & [ WordId ] , gbank : WordBank , sbank : WordBank , ) -> Bucket where T : Fn ( WordId , WordId , WordBank , WordBank ) -> Grade , { let guess_mark = compare ( guess , solution , gbank , sbank ) ; let mut bkt = vec ! [ ] ; for & word in left { let wmark = compare ( guess , word , gbank , sbank ) ; if wmark == guess_mark { bkt . push ( word ) ; } } bkt }
Creates a bucket for a given word given
a bank of guesses and possible solutions.
Creates a bucket for a given word given a bank of guesses and possible solutions .
guess
WordId
solution
WordId
compare
T
left
&[WordId]
gbank
WordBank
sbank
WordBank