Skip to content

Commit

Permalink
fix: typos, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoDog896 committed Jun 1, 2024
1 parent 3ada8d0 commit baf581d
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 10 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check
on: [pull_request]

jobs:
run:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4

- name: Check spelling of entire workspace
uses: crate-ci/typos@master
2 changes: 1 addition & 1 deletion crates/game-solver/src/reinforcement/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub trait Agent<S: State> {
/// Takes the given action, possibly mutating the current `State`.
fn take_action(&mut self, action: &S::A);
/// Takes a random action from the set of possible actions from this `State`. The default
/// implementation uses [State::random_action()](trait.State.html#method.random_action) to
/// implementation uses [`State::random_action()`](trait.State.html#method.random_action) to
/// determine the action to be taken.
fn pick_random_action(&mut self) -> S::A {
let action = self.current_state().random_action();
Expand Down
4 changes: 2 additions & 2 deletions crates/game-solver/src/reinforcement/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ struct QNetWorkConfig<const STATE_SIZE: usize, const ACTION_SIZE: usize, const I
/// for this. For example, you can ask the `DQNAgentTrainer` the expected values of all possible
/// actions in a given state.
///
/// The code is partially taken from https://github.com/coreylowman/dfdx/blob/main/dfdx/examples/advanced-rl-dqn.rs.
/// and https://github.com/milanboers/rurel.
/// The code is partially taken from <https://github.com/coreylowman/dfdx/blob/main/dfdx/examples/advanced-rl-dqn.rs>.
/// and <https://github.com/milanboers/rurel>.
pub struct DQNAgentTrainer<
S,
const STATE_SIZE: usize,
Expand Down
4 changes: 2 additions & 2 deletions crates/game-solver/src/transposition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ impl<
}

/// Create a new transposition cache with
/// an estimated 3/4ths of the remaining memory.
/// an estimated three fourths of the remaining memory.
#[must_use]
pub fn new() -> Self {
let score_size = std::mem::size_of::<Score>() as u64;

Self::with_capacity(
// get 3/4ths of the memory, and divide that by the size of a score
// get three fourths of the memory, and divide that by the size of a score
// to get the number of scores that can fit in the cache
(sysinfo::System::new_all().total_memory() * 3 / 4) / score_size,
)
Expand Down
3 changes: 2 additions & 1 deletion crates/games/src/chomp/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#[doc = include_str!("./README.md")]
#![doc = include_str!("./README.md")]

pub mod cli;

use array2d::Array2D;
Expand Down
2 changes: 2 additions & 0 deletions crates/games/src/domineering/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![doc = include_str!("./README.md")]

pub mod cli;

use array2d::Array2D;
Expand Down
3 changes: 2 additions & 1 deletion crates/games/src/nim/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#[doc = include_str!("./README.md")]
#![doc = include_str!("./README.md")]

pub mod cli;

use game_solver::game::{Game, ZeroSumPlayer};
Expand Down
3 changes: 2 additions & 1 deletion crates/games/src/order_and_chaos/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#[doc = include_str!("./README.md")]
#![doc = include_str!("./README.md")]

pub mod cli;

use array2d::Array2D;
Expand Down
3 changes: 2 additions & 1 deletion crates/games/src/reversi/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#[doc = include_str!("./README.md")]
#![doc = include_str!("./README.md")]

pub mod cli;

use array2d::Array2D;
Expand Down
3 changes: 2 additions & 1 deletion crates/games/src/tic_tac_toe/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#[doc = include_str!("./README.md")]
#![doc = include_str!("./README.md")]

pub mod cli;

use game_solver::game::{Game, ZeroSumPlayer};
Expand Down

0 comments on commit baf581d

Please sign in to comment.