Merge pull request #4 from sgoudham/v0.2.0
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e7e4a7aef84ea7b6372a6f8843a34920859fe16d6bd0b1515cb42a050fbe8a8d
|
||||
size 5075736
|
||||
oid sha256:fc99a3c03cc99b715f4bb7a598c3a15eb0bdf58e40a383b9ec5084c5186897a1
|
||||
size 43789
|
||||
|
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 474 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 171 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
@ -1,38 +1,38 @@
|
||||
pub const FACES_SIZE: usize = 14;
|
||||
pub const FACES: [&[u8]; FACES_SIZE] = [
|
||||
b"OwO",
|
||||
b"UwU",
|
||||
b">w<",
|
||||
b"^w^",
|
||||
b"^-^",
|
||||
b":3",
|
||||
b"x3",
|
||||
b"xDD",
|
||||
b";;w;;",
|
||||
b">_<",
|
||||
b">_>",
|
||||
b"^.^",
|
||||
b":33",
|
||||
b"uWu",
|
||||
b"OwO ",
|
||||
b"UwU ",
|
||||
b">w< ",
|
||||
b"^w^ ",
|
||||
b"^-^ ",
|
||||
b":3 ",
|
||||
b"x3 ",
|
||||
b"xDD ",
|
||||
b";;w;; ",
|
||||
b">_< ",
|
||||
b">_> ",
|
||||
b"^.^ ",
|
||||
b":33 ",
|
||||
b"uWu ",
|
||||
];
|
||||
|
||||
pub const ACTIONS_SIZE: usize = 17;
|
||||
pub const ACTIONS: [&[u8]; ACTIONS_SIZE] = [
|
||||
b"*notices bulge*",
|
||||
b"*cries*",
|
||||
b"*hugs tightly*",
|
||||
b"*screams*",
|
||||
b"*looks away*",
|
||||
b"*blushes*",
|
||||
b"*sweats*",
|
||||
b"*cuddles you*",
|
||||
b"*moans*",
|
||||
b"*giggles shyly*",
|
||||
b"*looks at you*",
|
||||
b"*twerks*",
|
||||
b"*sighs*",
|
||||
b"*leans over*",
|
||||
b"*pokes you*",
|
||||
b"*teleports behind you*",
|
||||
b"*shuffles closer*",
|
||||
b"*notices bulge* ",
|
||||
b"*cries* ",
|
||||
b"*hugs tightly* ",
|
||||
b"*screams* ",
|
||||
b"*looks away* ",
|
||||
b"*blushes* ",
|
||||
b"*sweats* ",
|
||||
b"*cuddles you* ",
|
||||
b"*moans* ",
|
||||
b"*giggles shyly* ",
|
||||
b"*looks at you* ",
|
||||
b"*twerks* ",
|
||||
b"*sighs* ",
|
||||
b"*leans over* ",
|
||||
b"*pokes you* ",
|
||||
b"*teleports behind you* ",
|
||||
b"*shuffles closer* ",
|
||||
];
|
@ -0,0 +1,34 @@
|
||||
use std::hash::Hasher;
|
||||
|
||||
use ahash::AHasher;
|
||||
use rand::distributions::uniform::{SampleRange, SampleUniform};
|
||||
use rand::{Rng, RngCore, SeedableRng};
|
||||
use rand_xoshiro::Xoshiro256Plus;
|
||||
|
||||
pub struct UwUSeeder {
|
||||
rng: Xoshiro256Plus,
|
||||
}
|
||||
|
||||
impl UwUSeeder {
|
||||
pub fn new(word: &[u8], random: bool) -> UwUSeeder {
|
||||
let rand_u64 = if !random {
|
||||
let mut hasher = AHasher::new_with_keys(0, 0);
|
||||
hasher.write(word);
|
||||
hasher.finish()
|
||||
} else {
|
||||
rand::rngs::OsRng::default().next_u64()
|
||||
};
|
||||
|
||||
UwUSeeder {
|
||||
rng: Xoshiro256Plus::seed_from_u64(rand_u64),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn random_float(&mut self) -> f64 {
|
||||
self.rng.gen_range(0.0..1.0)
|
||||
}
|
||||
|
||||
pub fn random_int<T: SampleUniform, R: SampleRange<T>>(&mut self, range: R) -> T {
|
||||
self.rng.gen_range(range)
|
||||
}
|
||||
}
|