Skip to content

Commit

Permalink
โ„Ž
Browse files Browse the repository at this point in the history
  • Loading branch information
krashanoff committed Apr 9, 2021
1 parent 8f5638c commit b6a7197
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
use std::{env::args, iter::FromIterator, process::exit};
#![allow(non_snake_case)]
use std::{env::args, process::exit};

//
// H
//
// For the dead week enjoyer.
//
// WTFPL
//

/// Encodes a single four-bit value to `baseH`.
fn encode_u4(c: &u8) -> char {
Expand Down Expand Up @@ -92,10 +96,7 @@ fn main() {
die("Usage: H [edED] .*")
}

let bytes = vargs[2..].iter().fold(String::new(), |a, e| {
String::from_iter(a.chars().chain(e.chars()))
});

let bytes = vargs[2..].join(" ");
match vargs[1].to_uppercase().as_str() {
"E" => print!("{}", encode(&bytes)),
"D" => print!("{}", decode(&bytes)),
Expand Down

0 comments on commit b6a7197

Please sign in to comment.