This commit is contained in:
rzmk 2023-09-21 12:14:36 +00:00
parent a925f41d50
commit 78c9ee1c67
2 changed files with 6 additions and 6 deletions

View file

@ -2,7 +2,7 @@
<p>Implementations of mathematical and technical concepts in Rust.</p> <p>Implementations of mathematical and technical concepts in Rust.</p>
<p>View <a href="#modules">the modules section</a> for the various implementations based on the subject.</p> <p>View <a href="#modules">the modules section</a> for the various implementations based on the subject.</p>
<h2 id="example"><a href="#example">Example</a></h2> <h2 id="example"><a href="#example">Example</a></h2>
<p>Heres an example of using the <code>ladderz</code> crate to get the factors and factor pairs of a number in sorted order. <p>Heres an example of using the <code>ladderz</code> crate to get the factors and factor pairs of a positive integer in sorted order.
Well assume youre using Bash as your terminal.</p> Well assume youre using Bash as your terminal.</p>
<p>First lets create a new Rust project and change into the project directory:</p> <p>First lets create a new Rust project and change into the project directory:</p>
<div class="example-wrap"><pre class="language-bash"><code>cargo new my_ladderz_project <div class="example-wrap"><pre class="language-bash"><code>cargo new my_ladderz_project
@ -50,7 +50,7 @@ cd my_ladderz_project
<p>Now lets build the projects binary file so we can run it from the command line:</p> <p>Now lets build the projects binary file so we can run it from the command line:</p>
<div class="example-wrap"><pre class="language-bash"><code>cargo build --release <div class="example-wrap"><pre class="language-bash"><code>cargo build --release
</code></pre></div> </code></pre></div>
<p>Our runnable binary file should be located at the local path <code>./target/release/my_ladders_project</code> (or <code>./target/release/my_ladders_project.exe</code> for Windows). Lets run it with the number <code>12</code> as input:</p> <p>Our runnable binary file should be located at the local path <code>./target/release/my_ladders_project</code> (or <code>./target/release/my_ladders_project.exe</code> for Windows). Lets run it with the positive integer <code>12</code> as input:</p>
<div class="example-wrap"><pre class="language-bash"><code>./target/release/my_ladderz_project 12 <div class="example-wrap"><pre class="language-bash"><code>./target/release/my_ladderz_project 12
</code></pre></div> </code></pre></div>
<p>If you have a <code>.exe</code> file instead, you can run it with:</p> <p>If you have a <code>.exe</code> file instead, you can run it with:</p>
@ -60,5 +60,5 @@ cd my_ladderz_project
<div class="example-wrap"><pre class="rust rust-example-rendered"><code>List of factors of <span class="number">12</span>: [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">6</span>, <span class="number">12</span>] <div class="example-wrap"><pre class="rust rust-example-rendered"><code>List of factors of <span class="number">12</span>: [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">6</span>, <span class="number">12</span>]
List of factor pairs of <span class="number">12</span>: [(<span class="number">1</span>, <span class="number">12</span>), (<span class="number">2</span>, <span class="number">6</span>), (<span class="number">3</span>, <span class="number">4</span>)]</code></pre></div> List of factor pairs of <span class="number">12</span>: [(<span class="number">1</span>, <span class="number">12</span>), (<span class="number">2</span>, <span class="number">6</span>), (<span class="number">3</span>, <span class="number">4</span>)]</code></pre></div>
<p>Great! Weve successfully used the <code>ladderz</code> crate to get the factors and factor pairs of a number in sorted order.</p> <p>Great! Weve successfully used the <code>ladderz</code> crate to get the factors and factor pairs of a positive integer in sorted order.</p>
</div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="pre_algebra/index.html" title="mod ladderz::pre_algebra">pre_algebra</a></div><div class="desc docblock-short">Various pre-algebra implementations including factor pairs, factors, multiples, and more.</div></li></ul></section></div></main></body></html> </div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="pre_algebra/index.html" title="mod ladderz::pre_algebra">pre_algebra</a></div><div class="desc docblock-short">Various pre-algebra implementations including factor pairs, factors, multiples, and more.</div></li></ul></section></div></main></body></html>

View file

@ -98,7 +98,7 @@
//! //!
//! # Example //! # Example
//! //!
//! Here&#39;s an example of using the `ladderz` crate to get the factors and factor pairs of a number in sorted order. //! Here&#39;s an example of using the `ladderz` crate to get the factors and factor pairs of a positive integer in sorted order.
//! We&#39;ll assume you&#39;re using Bash as your terminal. //! We&#39;ll assume you&#39;re using Bash as your terminal.
//! //!
//! First let&#39;s create a new Rust project and change into the project directory: //! First let&#39;s create a new Rust project and change into the project directory:
@ -159,7 +159,7 @@
//! cargo build --release //! cargo build --release
//! ``` //! ```
//! //!
//! Our runnable binary file should be located at the local path `./target/release/my_ladders_project` (or `./target/release/my_ladders_project.exe` for Windows). Let&#39;s run it with the number `12` as input: //! Our runnable binary file should be located at the local path `./target/release/my_ladders_project` (or `./target/release/my_ladders_project.exe` for Windows). Let&#39;s run it with the positive integer `12` as input:
//! //!
//! ```bash //! ```bash
//! ./target/release/my_ladderz_project 12 //! ./target/release/my_ladderz_project 12
@ -178,7 +178,7 @@
//! List of factor pairs of 12: [(1, 12), (2, 6), (3, 4)] //! List of factor pairs of 12: [(1, 12), (2, 6), (3, 4)]
//! ``` //! ```
//! //!
//! Great! We&#39;ve successfully used the `ladderz` crate to get the factors and factor pairs of a number in sorted order. //! Great! We&#39;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. /// Various pre-algebra implementations including factor pairs, factors, multiples, and more.
</span><span class="kw">pub mod </span>pre_algebra; </span><span class="kw">pub mod </span>pre_algebra;