Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#![feature(random)] use std::{iter::repeat, random::random, str::Split, thread::sleep, time::Duration}; fn main() { let randomize = |s| random::
(..).then_some(s); let mut sources = vec![ repeat("1234&567".to_owned()).filter_map(randomize), repeat("45&56&78&89".to_owned()).filter_map(randomize), repeat("789".to_owned()).filter_map(randomize), ]; let mut texts: Vec
= vec![ "1234&567".to_owned(), "45&56&78&89".to_owned(), "789".to_owned(), ]; let mut iters: Vec
> = texts.iter().map(|s| s.split('&')).collect(); loop { for iter in iters.iter_mut() { if let Some(s) = iter.next() { print!("{}", s); } } println!(""); let new_strings: Vec<(usize, String)> = sources .iter_mut() .enumerate() .filter_map(|(i, s)| s.next().map(|s| (i, s))) .collect(); for (i, s) in new_strings { drop(iters); texts[i] = s; // Want to rebuild one iterator for a new string // iters[i] = s.split('&'); iters = texts.iter().map(|s| s.split('&')).collect(); } sleep(Duration::from_millis(100)); } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)