Expand description
§Introduction
Easy Adds is a crate which provides simple rust for beginers and schools Rust is not an easy langage for beginers but with this crate they can do cool things without dificulty
For using this library writte this in the first line of your code
extern crate easy_adds;
use easy_adds::*;§Some usefull functions
// Generate a random number between 0 and 1
random_f64()
// NOTE: You can also use random_f32 which return a f32 number instead of a f64 number
// You can also generate a number between two numbers with:
random(-5,5)
// This function returns a i32 between the first and the second number (NOTE: The first number is included but not the second)
// Get an input form the user of the given type ex: input_i64("Type a number: ")
input_<Type>("Mesage to sended to the user")
// Here all the types supported: f32,f64,bool,i8,i16,i32,i64,u8,u16,u32,u64,string
// Note to make a string input: input("Mesage to sended to the user")
// You can also use the try_ statement to get an Option<Type> like:
try_input_<Type>("Mesage to sended to the user")
// This return an option of the given type an this is avaible for all types of the input expect StringFunctions§
- input
- This function take a
Stringinput from the user likeinput_strandinput_string - input_
bool - This function take a
boolinput from the user and return anboolreturn false if there are an bad input - input_
f32 - This function take a
f32input from the user and return anf32but panic if bad input - input_
f64 - This function take a
f64input from the user and return anf64but panic if bad input - input_
i8 - This function take a
i8input from the user and return ani8but panic if bad input - input_
i16 - This function take a
i16input from the user and return ani16but panic if bad input - input_
i32 - This function take a
i32input from the user and return ani32but panic if bad input - input_
i64 - This function take a
i64input from the user and return ani64but panic if bad input - input_
str - This function take a
Stringinput from the user likeinputandinput_string - input_
string - This function take a
Stringinput from the user likeinputandinput_str - input_
u8 - This function take a
u8input from the user and return anu8but panic if bad input - input_
u16 - This function take a
u16input from the user and return anu16but panic if bad input - input_
u32 - This function take a
u32input from the user and return anu32but panic if bad input - input_
u64 - This function take a
u64input from the user and return anu64but panic if bad input - random
- This function generate random
i32betweeni32startandendBased on top ofrandcrate - random_
f32 - This function generate random
f32between 0 and 1. Based on top ofrandcrate. - random_
f64 - This function generate random
f64between 0 and 1. Based on top ofrandcrate. - try_
input_ bool - This function take a
boolinput from the user and return anOption - try_
input_ f32 - This function take a
f32input from the user and return anOption - try_
input_ f64 - This function take a
f64input from the user and return anOption - try_
input_ i8 - This function take a
i8input from the user and return anOption - try_
input_ i16 - This function take a
i16input from the user and return anOption - try_
input_ i32 - This function take a
i32input from the user and return anOption - try_
input_ i64 - This function take a
i64input from the user and return anOption - try_
input_ u8 - This function take a
u8input from the user and return anOption - try_
input_ u16 - This function take a
u16input from the user and return anOption - try_
input_ u32 - This function take a
u32input from the user and return anOption - try_
input_ u64 - This function take a
u64input from the user and return anOption