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 String
Functions§
- input
- This function take a
String
input from the user likeinput_str
andinput_string
- input_
bool - This function take a
bool
input from the user and return anbool
return false if there are an bad input - input_
f32 - This function take a
f32
input from the user and return anf32
but panic if bad input - input_
f64 - This function take a
f64
input from the user and return anf64
but panic if bad input - input_
i8 - This function take a
i8
input from the user and return ani8
but panic if bad input - input_
i16 - This function take a
i16
input from the user and return ani16
but panic if bad input - input_
i32 - This function take a
i32
input from the user and return ani32
but panic if bad input - input_
i64 - This function take a
i64
input from the user and return ani64
but panic if bad input - input_
str - This function take a
String
input from the user likeinput
andinput_string
- input_
string - This function take a
String
input from the user likeinput
andinput_str
- input_
u8 - This function take a
u8
input from the user and return anu8
but panic if bad input - input_
u16 - This function take a
u16
input from the user and return anu16
but panic if bad input - input_
u32 - This function take a
u32
input from the user and return anu32
but panic if bad input - input_
u64 - This function take a
u64
input from the user and return anu64
but panic if bad input - random
- This function generate random
i32
betweeni32
start
andend
Based on top ofrand
crate - random_
f32 - This function generate random
f32
between 0 and 1. Based on top ofrand
crate. - random_
f64 - This function generate random
f64
between 0 and 1. Based on top ofrand
crate. - try_
input_ bool - This function take a
bool
input from the user and return anOption
- try_
input_ f32 - This function take a
f32
input from the user and return anOption
- try_
input_ f64 - This function take a
f64
input from the user and return anOption
- try_
input_ i8 - This function take a
i8
input from the user and return anOption
- try_
input_ i16 - This function take a
i16
input from the user and return anOption
- try_
input_ i32 - This function take a
i32
input from the user and return anOption
- try_
input_ i64 - This function take a
i64
input from the user and return anOption
- try_
input_ u8 - This function take a
u8
input from the user and return anOption
- try_
input_ u16 - This function take a
u16
input from the user and return anOption
- try_
input_ u32 - This function take a
u32
input from the user and return anOption
- try_
input_ u64 - This function take a
u64
input from the user and return anOption