update readme and add action
All checks were successful
Release crate / Publish to crates.io and create GitHub Release (release) Successful in 1m41s
All checks were successful
Release crate / Publish to crates.io and create GitHub Release (release) Successful in 1m41s
This commit is contained in:
12
README.md
12
README.md
@@ -14,7 +14,7 @@ Logic and rules for the German card game Schafkopf. This crate provides types
|
||||
and helpers for deck construction, common game modes and basic trick-taking
|
||||
logic.
|
||||
|
||||
**Crate:** `schafkopf-logic` • **Version:** 0.1.0
|
||||
**Crate:** [`schafkopf-logic`](https://crates.io/crates/schafkopf-logic)
|
||||
|
||||
## Features
|
||||
|
||||
@@ -36,13 +36,13 @@ fn main() {
|
||||
deck.shuffle();
|
||||
let hands = deck.deal_4x8().expect("deck should contain 32 cards");
|
||||
|
||||
// form a sample trick from the first card of each hand
|
||||
// Form a sample trick from the first card of each hand and print it
|
||||
let trick = [&hands[0][0], &hands[1][0], &hands[2][0], &hands[3][0]];
|
||||
let winner = Gamemode::Sauspiel(Suit::Herz).winning_card(trick);
|
||||
println!("Winning card: {}", winner);
|
||||
println!("Trick: {}, {}, {}, {}", trick[0], trick[1], trick[2], trick[3]);
|
||||
|
||||
// rank points example
|
||||
assert_eq!(Rank::Ass.points(), 11);
|
||||
// Determine the winner for a sample game mode (Sauspiel with Schell)
|
||||
let winner = Gamemode::Sauspiel(Suit::Schell).winning_card(trick);
|
||||
println!("Winning card: {}", winner);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user