Skip to content

Commit

Permalink
Move doc comment from main.rs to lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
iahmadgad committed Sep 20, 2024
1 parent cf8831f commit 793b364
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 33 deletions.
31 changes: 31 additions & 0 deletions rock-paper-scissors/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
//! > Rock Paper Scissors written in Rust
//! # Guide
//! firstly run this crate via cargo:
//! ```sh
//! cargo run --package rock-paper-scissors
//! ```
//! then it will prompt you for play mode, whether singleplayer or multiplayer:
//! ```sh
//! Rock Paper Scissors by Ahmad
//! choose play mode:
//! 1. singleplayer
//! 2. multiplayer
//! input:
//! ```
//! Type `1` for singleplayer or `2` for multiplayer.
//! //! If you chose multiplayer it will prompt you for player names:
//! ```sh
//! player:
//! ```
//! then it will prompt you for max points number:
//! ```sh
//! Enter max points number:
//! ```
//! Supposing you typed `3` it will continue to run the game & prompt each turn for player's choice until someone gets `3` points.
//! this are valid choices:
//! | Choice | Alias |
//! | -------- | ------- |
//! | `rock` | `r` |
//! | `paper` | `p` |
//! | `scissors` | `s` |

pub mod choice;
pub mod game;
pub mod mode;
Expand Down
33 changes: 0 additions & 33 deletions rock-paper-scissors/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,36 +1,3 @@
//! > Rock Paper Scissors written in Rust
//! # Guide
//! firstly run this crate via cargo:
//! ```sh
//! cargo run --package rock-paper-scissors
//! ```
//! then it will prompt you for play mode, whether singleplayer or multiplayer:
//! ```sh
//! Rock Paper Scissors by Ahmad
//! choose play mode:
//! 1. singleplayer
//! 2. multiplayer
//! input:
//! ```
//! Type `1` for singleplayer or `2` for multiplayer.
//! //! If you chose multiplayer it will prompt you for player names:
//! ```sh
//! player:
//! ```
//! then it will prompt you for max points number:
//! ```sh
//! Enter max points number:
//! ```
//! Supposing you typed `3` it will continue to run the game & prompt each turn for player's choice until someone gets `3` points.
//! this are valid choices:
//! | Choice | Alias |
//! | -------- | ------- |
//! | `rock` | `r` |
//! | `paper` | `p` |
//! | `scissors` | `s` |



pub use rock_paper_scissors::{choice::Choice, game::Game, mode::Mode, util::mreadln};

fn main() {
Expand Down

0 comments on commit 793b364

Please sign in to comment.