Skip to content

Commit

Permalink
fix: fix typos (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
radlinskii authored Oct 8, 2023
1 parent 35e89a8 commit ac95ca1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This text is a placeholder, and this is the input that you should write when the
On the bottom-right corner there is a help message saying that to start the test you need to press `'e'` (enter the test) or leave by pressing `'q'`
When test is running you can see how much time you have left in bottom-left corner.

You can pause the test by pressinng <Esc>, to resume it press `'e'` again.
You can pause the test by pressing <Esc>, to resume it press `'e'` again.

WPM (words per minute) score is calculated as amount of typed characters divided by 5 (word), divided by the duration normalized to 60 seconds (minute).

Expand Down Expand Up @@ -44,10 +44,8 @@ Default config looks like this:
| `numbers` | `false` | boolean | flag indicating if numbers should be inserted in expected input |
| `numbers_ratio` | `0.05` if numbers=TRUE | number | ratio for putting numbers in the test |
| `dictionary_path` | `"src/dict/words.txt"` | string | dictionary words to sample from while creating test's expected input |

`NOTE: If provided numbers_ratio is not between 0 to 1.0, Default numbers_ratio = 0.05 will be used.`


`NOTE: If provided numbers_ratio is not between 0 to 1.0, Default numbers_ratio = 0.05 will be used.`

You can provide this config as options when running the program like so:

Expand Down Expand Up @@ -94,7 +92,7 @@ To submit a contribution, follow these general steps:

1. Create your own fork of the code repository.
2. Make the desired changes in your fork.
3. Ennsure your changes adhere to the code style and quality standards.
3. Ensure your changes adhere to the code style and quality standards.

### Hacktoberfest 2023

Expand Down
16 changes: 10 additions & 6 deletions src/runner.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Test runner module. Controles the test flow, checks input, and returns results.
//! Test runner module. Controls the test flow, checks input, and returns results.
//!
//! This is the main module that is orchestrating the flow of the test.
//! It prints the expected input as placeholder, then it reads user input and reacts to it.
Expand Down Expand Up @@ -35,7 +35,7 @@ enum InputMode {
Editing,
}

/// Struct that runs and controlles the test.
/// Struct that runs and controls the test.
pub struct Runner {
input: String,
input_mode: InputMode,
Expand Down Expand Up @@ -196,7 +196,7 @@ impl Runner {
///
/// There are two areas being rendered,
/// input area - where user input and expected input is displayed,
/// and info arae - where help message and time remaining is rendered.
/// and info area - where help message and time remaining is rendered.
pub fn render(&mut self, frame: &mut impl FrameWrapperInterface, time_elapsed: u64) {
let areas = Layout::default()
.direction(Direction::Vertical)
Expand Down Expand Up @@ -308,8 +308,12 @@ impl Runner {
{
let input = Paragraph::new(expected_input_char.to_string()).style(
match input_char == expected_input_char {
true => Style::default().bg(self.config.color_config.correct_match_bg).fg(self.config.color_config.correct_match_fg),
false => Style::default().bg(self.config.color_config.incorrect_match_bg).fg(self.config.color_config.incorrect_match_fg),
true => Style::default()
.bg(self.config.color_config.correct_match_bg)
.fg(self.config.color_config.correct_match_fg),
false => Style::default()
.bg(self.config.color_config.incorrect_match_bg)
.fg(self.config.color_config.incorrect_match_fg),
},
);
frame.render_widget(
Expand Down Expand Up @@ -379,7 +383,7 @@ impl Runner {
///
/// `raw_valid_characters_count` is number of times when valid character was pressed.
/// `raw_mistakes_count is number` of times when invalid character was pressed.
/// `raw_typed_characters_count` is number of key presses that happened in `Edting` mode during
/// `raw_typed_characters_count` is number of key presses that happened in `Editing` mode during
/// the test.
/// `raw_accuracy` is ratio of `raw_valid_characters_count` to `raw_typed_characters_count`.
///
Expand Down

0 comments on commit ac95ca1

Please sign in to comment.