From 793b364d5e90cab3bcc69e9778a6fb3ff5c37c16 Mon Sep 17 00:00:00 2001 From: Ahmad Asaad Date: Fri, 20 Sep 2024 15:43:33 +0300 Subject: [PATCH] Move doc comment from main.rs to lib.rs --- rock-paper-scissors/src/lib.rs | 31 +++++++++++++++++++++++++++++++ rock-paper-scissors/src/main.rs | 33 --------------------------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/rock-paper-scissors/src/lib.rs b/rock-paper-scissors/src/lib.rs index fb7cb79..de54fdf 100644 --- a/rock-paper-scissors/src/lib.rs +++ b/rock-paper-scissors/src/lib.rs @@ -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; diff --git a/rock-paper-scissors/src/main.rs b/rock-paper-scissors/src/main.rs index 518c7b7..57f226a 100644 --- a/rock-paper-scissors/src/main.rs +++ b/rock-paper-scissors/src/main.rs @@ -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() {