Skip to content

Testing crates.io uploads and documention with a game of TicTacToe

License

Notifications You must be signed in to change notification settings

L19579/L19_Terminal_TicTacToe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

L19_Terminal_TicTacToe

License License: MIT

Purpose: Educational

Testing Cargo.io submissions, versioning, and documentation.

Tests will be written around a game of TicTacToe. See TODO.


Instructions

Environment

Linux, x86_64.

Installing rust

See: Rustup

Installing L19_Terminal_TicTacToe

  git clone https://github.com/L19579/L19_Terminal_TicTacToe.git # Download repo
  cd #insert_repo_directory
  cargo build --release

Launching

  ./target/release/l19_terminal_tictactoe

Controls

  • Game input bindings are set in main.rs. System will adapt to UTF-8 binding inputs 2 chars in length listed chronologically.
  use l19_terminal_tictactoe as l19;
  
  //-- snip
  
  let input_bindings: Hashmap::<&str, usize> = HashMap::from([
      ("a1", 0),
      ("a2", 1),
      ("a3", 2),
      ("b1", 3),
      ("b2", 4),
      ("b3", 5),
      ("c1", 6),
      ("c2", 7),
      ("c3", 8),

  ]);

  let mut gm = l19::GameMaster::new(&input_bindings);
  
  //-- snip
  • Type in input when prompted. This "bot" is just a pseudorandom number generator. It takes effort to lose.

Opener Closer


External links and documentation

Package (0.1.2): Crates.io

Published documentation: Docs.rs


TODO - Complete

  • Randomizer decides which player starts.
  • X is assigned to player 1, O to player 2.
  • Turn based, updated board is printed below. Terminal isn't cleared for simplicity.
  • Player is presented with cell ID and types it in to select position when prompted.
  • X / O are drawn when player/AI make their move.
  • Table state is saved with every move.
  • System checks for wins after positions are submitted.
  • Full code documentation on Docs.rs
  • Top level description on Github; Listed as release.
  • Top level description on Crates.io; Listed as release.

About

Testing crates.io uploads and documention with a game of TicTacToe

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages