mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-19 08:11:14 -08:00
todo list
This commit is contained in:
@@ -1,6 +1,19 @@
|
|||||||
use rand::{Rng, prelude::thread_rng};
|
use rand::{Rng, prelude::thread_rng};
|
||||||
use std::{io};
|
use std::{io};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* todo list:
|
||||||
|
*
|
||||||
|
* make a 2 player game functional
|
||||||
|
*
|
||||||
|
* add more players
|
||||||
|
*
|
||||||
|
* use a 3 deck pool of cards instead of an infinite amount
|
||||||
|
*
|
||||||
|
* keep track of player bets
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//DATA
|
//DATA
|
||||||
struct CARD {
|
struct CARD {
|
||||||
name: String,
|
name: String,
|
||||||
@@ -24,6 +37,12 @@ struct DECK {
|
|||||||
}
|
}
|
||||||
struct PLAYER {
|
struct PLAYER {
|
||||||
hand: HAND,
|
hand: HAND,
|
||||||
|
balance: usize,
|
||||||
|
}
|
||||||
|
impl PLAYER {
|
||||||
|
fn new() -> PLAYER {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct GAME {
|
struct GAME {
|
||||||
@@ -35,7 +54,7 @@ struct GAME {
|
|||||||
discard_pile: DECK,
|
discard_pile: DECK,
|
||||||
}
|
}
|
||||||
impl GAME {
|
impl GAME {
|
||||||
fn start(num_players:u8) {
|
fn start(num_players:u8) -> GAME {
|
||||||
//ask user how many players there should be, not including them
|
//ask user how many players there should be, not including them
|
||||||
let num_players = loop {
|
let num_players = loop {
|
||||||
//input loop
|
//input loop
|
||||||
@@ -59,6 +78,12 @@ impl GAME {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//return a game
|
||||||
|
return GAME { human_player: PLAYER::new(), computer_players: (), dealer: (), deck: (), discard_pile: () }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user