diff --git a/ladderz/src/lib.rs b/ladderz/src/lib.rs index 23c6af0..3a1656a 100644 --- a/ladderz/src/lib.rs +++ b/ladderz/src/lib.rs @@ -2,7 +2,11 @@ //! //! Implementations of mathematical and technical concepts in Rust. //! -//! View [the modules section](#modules) for the various implementations based on the subject. +//! ## Subjects +//! +//! The modules for currently supported subjects are: +//! +//! - [`pre_algebra`] //! //! # Example //! @@ -89,4 +93,20 @@ //! Great! We've successfully used the `ladderz` crate to get the factors and factor pairs of a positive integer in sorted order. /// Various pre-algebra implementations including factor pairs, factors, multiples, and more. +/// +/// # Example +/// +/// ```rust +/// use ladderz::pre_algebra::get_factors; +/// +/// fn main() { +/// let x: u32 = 10; +/// println!("The factors of {x} are {:?}.", get_factors(x)); +/// } +/// ``` +/// +/// ```console +/// The factors of 10 are {1, 5, 2, 10}. +/// ``` +/// pub mod pre_algebra; diff --git a/ladderz/src/main.rs b/ladderz/src/main.rs new file mode 100644 index 0000000..7c09755 --- /dev/null +++ b/ladderz/src/main.rs @@ -0,0 +1,6 @@ +use ladderz::pre_algebra::get_factors; + +fn main() { + let x: u32 = 10; + println!("The factors of {x} are {:?}.", get_factors(x)); + } \ No newline at end of file