Update to 2021 edition
This commit is contained in:
parent
2b866ac227
commit
b8a82294d1
9 changed files with 16 additions and 16 deletions
|
@ -2,6 +2,7 @@
|
|||
name = "rust_hanabi"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeff Wu <wuthefwasthat@gmail.com>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
rand = "0.3.0"
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::hash::Hash;
|
|||
use std::ops::{Index, IndexMut};
|
||||
use std::slice;
|
||||
|
||||
use game::*;
|
||||
use crate::game::*;
|
||||
|
||||
// trait representing information about a card
|
||||
pub trait CardInfo {
|
||||
|
|
|
@ -236,7 +236,7 @@ fn get_results_table() -> String {
|
|||
}
|
||||
fn concat_twolines(body: Vec<TwoLines>) -> String {
|
||||
body.into_iter().fold(String::default(), |output, (a, b)| {
|
||||
(output + &a + "\n" + &b + "\n")
|
||||
output + &a + "\n" + &b + "\n"
|
||||
})
|
||||
}
|
||||
let header = make_twolines(&player_nums, (space.clone(), dashes), &|n_players| {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
use crossbeam;
|
||||
use fnv::FnvHashMap;
|
||||
use rand::{self, Rng, SeedableRng};
|
||||
use std::fmt;
|
||||
|
||||
use game::*;
|
||||
use strategy::*;
|
||||
use crate::game::*;
|
||||
use crate::strategy::*;
|
||||
|
||||
fn new_deck(seed: u32) -> Cards {
|
||||
let mut deck: Cards = Cards::new();
|
||||
|
|
|
@ -2,8 +2,8 @@ use fnv::{FnvHashMap, FnvHashSet};
|
|||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
use game::*;
|
||||
use strategy::*;
|
||||
use crate::game::*;
|
||||
use crate::strategy::*;
|
||||
|
||||
// strategy that explicitly cheats by using Rc/RefCell
|
||||
// serves as a reference point for other strategies
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use game::*;
|
||||
use crate::game::*;
|
||||
use crate::strategy::*;
|
||||
use rand::{self, Rng};
|
||||
use strategy::*;
|
||||
|
||||
// dummy, terrible strategy, as an example
|
||||
#[derive(Clone)]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use game::*;
|
||||
use helpers::*;
|
||||
use crate::game::*;
|
||||
use crate::helpers::*;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ModulusInformation {
|
||||
|
|
|
@ -2,10 +2,10 @@ use float_ord::*;
|
|||
use fnv::{FnvHashMap, FnvHashSet};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
use game::*;
|
||||
use helpers::*;
|
||||
use strategies::hat_helpers::*;
|
||||
use strategy::*;
|
||||
use crate::game::*;
|
||||
use crate::helpers::*;
|
||||
use crate::strategies::hat_helpers::*;
|
||||
use crate::strategy::*;
|
||||
|
||||
// TODO: use random extra information - i.e. when casting up and down,
|
||||
// we sometimes have 2 choices of value to choose
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use game::*;
|
||||
use crate::game::*;
|
||||
|
||||
// Traits to implement for any valid Hanabi strategy
|
||||
|
||||
|
|
Loading…
Reference in a new issue