mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-02-05 11:26:37 -08:00
🚀 Ace game in rust started
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -31,7 +31,7 @@ Pipfile
|
||||
|
||||
.DS_Store
|
||||
.vs/
|
||||
/target/
|
||||
**/target/
|
||||
Cargo.lock
|
||||
**/*.rs.bk
|
||||
/target
|
||||
|
||||
9
01_Acey_Ducey/rust/Cargo.toml
Normal file
9
01_Acey_Ducey/rust/Cargo.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "rust"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
rand = "0.8.5"
|
||||
28
01_Acey_Ducey/rust/src/main.rs
Normal file
28
01_Acey_Ducey/rust/src/main.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use std::io;
|
||||
|
||||
|
||||
fn main() {
|
||||
let mut user_bank: u16 = 100;
|
||||
|
||||
}
|
||||
|
||||
fn hello() {
|
||||
println!(" 🂡 ACEY DUCEY CARD GAME 🂱");
|
||||
println!("CREATIVE COMPUTING - MORRISTOWN, NEW JERSEY");
|
||||
println!(" ACEY-DUCEY IS PLAYED IN THE FOLLOWING MANNER");
|
||||
println!("THE DEALER (COMPUTER) DEALS TWO CARDS FACE UP");
|
||||
println!("YOU HAVE AN OPTION TO BET OR NOT BET DEPENDING");
|
||||
println!("ON WHETHER OR NOT YOU FEEL THE CARD WILL HAVE");
|
||||
println!("A VALUE BETWEEN THE FIRST TWO.");
|
||||
println!("IF YOU DO NOT WANT TO BET IN A ROUND, ENTER 0");
|
||||
}
|
||||
|
||||
fn card_name(card: u8) -> String {
|
||||
match card {
|
||||
11 => String::from("JACK"),
|
||||
12 => String::from("QUEEN"),
|
||||
13 => String::from("KING"),
|
||||
14 => String::from("ACE"),
|
||||
_ => card.to_string()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user