Skip to content

Instantly share code, notes, and snippets.

@siketyan
Last active August 1, 2022 14:53
Show Gist options
  • Save siketyan/862807844684a09ed8562423bcb045d4 to your computer and use it in GitHub Desktop.
Save siketyan/862807844684a09ed8562423bcb045d4 to your computer and use it in GitHub Desktop.
use itertools::FoldWhile::{Continue, Done};
use itertools::Itertools;
use rand::seq::SliceRandom;
fn main() {
println!(
"{}",
std::iter::repeat(())
.filter_map(|_| ["ドド", "スコ"].choose(&mut rand::thread_rng()))
.fold_while(String::new(), |mut acc, &v| {
acc.push_str(v);
match acc.ends_with("ドドスコスコスコドドスコスコスコドドスコスコスコ")
{
true => Done(acc),
_ => Continue(acc),
}
})
.into_inner()
+ "ラブ注入"
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment