From ab840b36e43e433d7cff9f5e1577eb4bb77d76e8 Mon Sep 17 00:00:00 2001 From: Leo Dev Date: Sat, 27 Jul 2024 09:21:34 +0200 Subject: [PATCH] :) --- src/main.rs | 26 +++++++++++++++++++++++--- src/utils.rs | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index c4e23ce..38d2319 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,7 @@ -use std::{fs, process}; +use std::str; +use std::thread::sleep; +use std::time::Duration; +use std::{fs, io::Read, process}; mod compiler; mod transpiler; mod utils; @@ -13,7 +16,7 @@ fn main() { .about("The wyst compiler") .arg( Arg::with_name("file") - .required_unless_one(&["stdio", "hex"]) + .required_unless_one(&["stdio", "hex", "logo"]) .help("Sets the input file to use"), ) .arg( @@ -42,8 +45,25 @@ fn main() { .takes_value(true) .help("Turn an identifier into hex"), ) + .arg(Arg::with_name("logo").long("logo").hide(true)) .get_matches(); - if matches.is_present("stdio") { + if matches.is_present("logo") { + println!("{}", utils::LOGO); + let mut byte = [4; 4]; + std::io::stdin().read_exact(&mut byte).unwrap(); + let egg = str::from_utf8(&byte).unwrap().to_string(); + let mut counter: u8 = 30; + if egg == "logo" { + loop { + if counter == 35 { + counter = 30; + } + println!("\x1B[2J\x1B[{}m{}", counter, utils::LOGO); + sleep(Duration::from_millis(400)); + counter += 1; + } + } + } else if matches.is_present("stdio") { println!("stdio mode!"); } else if matches.is_present("hex") { let ident = matches.value_of("hex").unwrap().to_string(); diff --git a/src/utils.rs b/src/utils.rs index 412d22f..08895fe 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -182,3 +182,54 @@ impl ModManager { problems } } + +pub const LOGO: &str = r#" + + + @@ @@@ @ + @@@@ @@@@@ @@@@ + @@@@ @@@@@@@@@@@@@@@@@@@ @@@@ + @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + @@@@@@@@@@@@@@@@@@@@@ @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