Skip to content

Commit f39adbc

Browse files
authored
Merge pull request #2 from AAAAAAAstravexton/patch-1
AAAAAAA
2 parents 86f97ee + 9b0b559 commit f39adbc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/main.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::{
1414
time::Duration,
1515
};
1616

17-
const CHAR_SET: &[&str] = &[
17+
const CHAAAAAAAAR_SET: &[&str] = &[
1818
"A̵̦̦̓͌͗͛̕",
1919
"A",
2020
"₳",
@@ -32,7 +32,7 @@ const CHAR_SET: &[&str] = &[
3232
"∀",
3333
];
3434

35-
const CHAOS: f64 = 0.20;
35+
const CHAAAAAAOS: f64 = 0.20;
3636

3737
#[derive(Clone, Copy)]
3838
enum Weight {
@@ -137,7 +137,7 @@ fn random_string() -> String {
137137
let mut rng = rand::thread_rng();
138138
let length = rng.gen_range(1..=16);
139139
(0..length)
140-
.map(|_| CHAR_SET[rng.gen_range(0..CHAR_SET.len())])
140+
.map(|_| CHAAAAAAAAR_SET[rng.gen_range(0..CHAAAAAAAAR_SET.len())])
141141
.collect()
142142
}
143143

@@ -185,7 +185,7 @@ fn main() -> io::Result<()> {
185185
while printer_running.load(Ordering::SeqCst) {
186186
if !printer_paused.load(Ordering::SeqCst) {
187187
if let Ok((max_x, max_y)) = size() {
188-
if rng.gen_bool(CHAOS) {
188+
if rng.gen_bool(CHAAAAAAOS) {
189189
streams.push(Stream::new(max_x, max_y));
190190
}
191191

@@ -278,11 +278,11 @@ mod tests {
278278
let mut appearances = HashSet::<&'static str>::new();
279279
for _ in 0..10000 {
280280
let s = random_string();
281-
appearances.extend(CHAR_SET.iter().filter(|&&c| s.contains(c)));
281+
appearances.extend(CHAAAAAAAAR_SET.iter().filter(|&&c| s.contains(c)));
282282
}
283283
assert_eq!(
284284
appearances.len(),
285-
CHAR_SET.len(),
285+
CHAAAAAAAAR_SET.len(),
286286
"Not all characters appeared in 10000 iterations"
287287
);
288288
}
@@ -369,17 +369,17 @@ mod tests {
369369
let trials = 10000;
370370

371371
for _ in 0..trials {
372-
if rand::thread_rng().gen_bool(CHAOS) {
372+
if rand::thread_rng().gen_bool(CHAAAAAAOS) {
373373
new_streams += 1;
374374
}
375375
}
376376

377377
let actual_probability = new_streams as f64 / trials as f64;
378378
assert!(
379-
(actual_probability - CHAOS).abs() < 0.02,
379+
(actual_probability - CHAAAAAAOS).abs() < 0.02,
380380
"Chaos probability {} significantly deviated from expected {}",
381381
actual_probability,
382-
CHAOS
382+
CHAAAAAAOS
383383
);
384384
}
385385

@@ -388,7 +388,7 @@ mod tests {
388388
let s = random_string();
389389
assert!(
390390
s.chars()
391-
.all(|c| CHAR_SET.iter().any(|&set| set.contains(c))),
391+
.all(|c| CHAAAAAAAAR_SET.iter().any(|&set| set.contains(c))),
392392
"Invalid characters in string: {}",
393393
s
394394
);

0 commit comments

Comments
 (0)