Make program 214 compliant

master
Tait Hoyem 2 years ago
parent 817f7816c6
commit 0c9f1f377d

@ -0,0 +1,11 @@
sayings/squishy.txt
sayings/love.txt
sayings/programming.txt
sayings/special-melly.txt
sayings/generic.txt
sayings/food.txt
sayings/blind.txt
sayings/sex.txt
sayings/quote.txt
sayings/music.txt
sayings/techies.txt

@ -0,0 +1,6 @@
It's a good thing you do not like me for my looks!
Shove this cane up your ass!
Your energy bill will always be lower than mine.
Read my pimples, see if they speak to you!
Follow me!
Don't forget your cane, idiot!

@ -0,0 +1,7 @@
We should go feed eachother cheese at the beach.
Let's watch a movie, your choice!
I want to squish your face!
I want to eat you, like a cheese ball!
I want to boop your nose!
Let's go work out together!
🤍💛!

@ -0,0 +1,5 @@
"You miss 100% of the shots you don't take"--Wayne Gretzky
"Money money money money!"--Mr. Krabs
"You could make a religion out of this!"--Bill Wurtz
"Be as humble as myself."--Kenye West
"Don't be a pussy!"--Tait

@ -0,0 +1,6 @@
If you don't make love to the coconut song, have you even lived?
Lick it; suck it; twist it; pull it!
JUST DO IT!
Can prostitutes work from home? And would it be over Zoom?
"My cock is community property!"
Happy D

@ -1,2 +1,8 @@
Smelly Melly!
belly, button
Melly, button
Free dorm food!
Let's go to Kelly's!
Let's go to the cheese store!
Let's go watch the sunset at the dock.
If I'm far away, just remember, I can't see you right now either.

@ -1,3 +1,4 @@
I'd like to peek at every one of your directories.
unzip; strip; touch; grep; mount; fsck; yes; more; fsck; fsck; umount; clean; sleep;
Run `curl https://melody-214.tait.tech` for more info funny sayings
Run `curl https://melody-214.tait.tech` for more!
nmcli dev wifi connect tait

@ -1,11 +1,6 @@
use lazy_static;
use crate::sayings::read_all_sayings;
use std::sync::Mutex;
use crate::sayings::read_all_sayings as s;
use std::sync::Mutex as M;
lazy_static! {
static ref SAYINGS: Mutex<Vec<String>> = Mutex::new(read_all_sayings());
}
pub fn all_sayings() -> Vec<String> {
SAYINGS.lock().expect("Error locking SAYINGS.").to_vec()
static ref SAYINGS:M<Vec<String>> = M::new(s());
}
pub fn all_sayings()->Vec<String>{SAYINGS.lock().expect("lock err").to_vec()}

@ -1,9 +0,0 @@
extern crate rand;
use rand::thread_rng;
use crate::all_sayings::all_sayings;
use crate::choose_saying::rand::prelude::IteratorRandom;
pub fn random_saying() -> String {
let mut rng = thread_rng();
all_sayings().iter().choose(&mut rng).expect("Error getting random saying.").to_string()
}

@ -0,0 +1,8 @@
use crate::env;
use crate::get_lines;
/// Gets the list of all files to load sayings from.
/// Panics on any kind of possible error
pub fn get_files() -> Vec<String> {
return get_lines::get_lines(env::gcf());
}

@ -0,0 +1,9 @@
use std::fs;
pub fn get_lines(file_name: String) -> Vec<String> {
fs::read_to_string(file_name)
.expect("Error reading some file")
.lines()
.map(|x| x.to_string())
.collect()
}

@ -1,7 +1,8 @@
pub mod saying_files;
pub mod env;
pub mod ns;
pub mod choose_saying;
/// All rise and hail the great pseudo-random number generator code!
pub mod randoms;
pub mod sayings;
pub mod all_sayings;
pub mod get_lines;
pub mod get_files;
#[macro_use] extern crate lazy_static;

@ -1,14 +1,8 @@
#[macro_use]
extern crate rocket;
extern crate lazy_static;
use melly_valentines::choose_saying::random_saying;
use melly_valentines::randoms::random_saying;
#[get("/")]
fn a() -> String {
random_saying()
}
fn a()->String{random_saying()}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/", routes![a])
}
fn rocket()->_{rocket::build().mount("/",routes![a])}

@ -1,3 +0,0 @@
pub fn new_saying() -> String {
return "Helo!".to_string();
}

@ -0,0 +1,7 @@
use rand::thread_rng;
use crate::all_sayings::all_sayings;
use rand::prelude::IteratorRandom;
pub fn random_saying() ->String{
all_sayings().iter().choose(&mut thread_rng()).expect("saying error").to_string()
}

@ -1,10 +0,0 @@
use std::fs;
use crate::env::gcf;
pub fn get_files() -> Vec<String> {
fs::read_to_string(gcf())
.expect("Error reading core file")
.lines()
.map(|x| x.to_string())
.collect()
}

@ -1,9 +1,6 @@
use crate::saying_files::get_files;
use crate::get_files::get_files;
use crate::get_lines::get_lines;
pub fn read_all_sayings() -> Vec<String> {
get_files()
.iter()
.map(|n| n.lines().map(|l| l.to_string()))
.flatten()
.collect()
pub fn read_all_sayings()-> Vec<String>{
get_files().iter().map(|n| n.lines().map(|l| get_lines(l.to_string()))).flatten().flatten().collect()
}

Loading…
Cancel
Save