Commit graph

12 commits

Author SHA1 Message Date
timotree3
a1bfa76b77 Merge branch 'rust-2021' into json_output_2021 2023-01-19 21:44:15 -05:00
timotree3
2b866ac227 Add specific versions for dependencies 2023-01-19 20:34:17 -05:00
phimuemue
c9b21fa047
Compile on rust 1.61, resolve warnings, fix some lints (#12)
* Fix getopts version

The pinned version does not compile anymore because of mutable aliasing:
* https://github.com/rust-lang/getopts/pull/61
* https://github.com/rust-lang/getopts/issues/110

This was achieved by temporarily setting the getopts version to "0.2.21"
in Cargo.toml, and running `cargo check`.

Note that this also converts the Cargo.lock to a new format.

* Fix warning: Instead of deprecated macro try!, use question mark operator

* Fix warning: Avoid anonymous parameters

* Fix warning: Use dyn on trait objects

* Fix warning: Avoid unneeded mutability

* Fix warning: Avoid redundant format in panic or assert

* Fix lint: Avoid redundant field names in initializers

* Fix lint: Avoid redundant clone

* Fix lint: Avoid literal cast

* Fix lint: Collapse if/else where applicable

I left some if/else branches in place, if there was a certain symmetry between the branches.

* Fix lint: Avoid needless borrow

I left some if/else branches in place, if there was a certain symmetry between the branches.

* Fix lint: Use cloned instead of custom closure

* Fix lint: Avoid unneeded trait bound

* Fix lint: Avoid unneeded trait bound (2) avoid redundant clone

* Fix lint: Use &[T] instead of &Vec<T>

* Fix lint: Avoid & on each pattern

* Fix lint: Avoid manual assign

* Fix lint: Use implicit return

* Fix lint: Merge if/else branches with same value

I left one complicated branch in place.

* Fix lint: Use is_empty instead of comparing len against 0

* Fix lint: Use sum instead of fold

* Fix lint: Avoid clone on Copy types
2022-07-05 11:05:13 -07:00
Felix Bauckholt
180d8c5f4e Second attempt at outputting JSON for hanabi.live
We don't support any notes yet.

Inside our GameState, we annotate each card with its index in the
original (reverse) deck. In order to support per-card notes, we should
probably share those annotations with the players, and refactor the
player code around them.
2019-03-22 03:50:01 +01:00
Felix Bauckholt
9364a06862 Improve ask_question strategy
I also replaced the callback architecture behind
`PublicInformation.ask_questions()` with a simpler method
`PublicInformation.ask_question()` that gets called repeatedly.

To make all float-based sorts easier, I used the `float-ord` package.
I also used it to clean up some of the sorting in `decide_wrapped()`.
2019-03-15 13:45:17 +01:00
Felix Bauckholt
ef860fa73b Make runs reproducible by replacing HashMaps with FnvHashMaps 2019-03-07 13:54:30 +01:00
Jeff Wu
737085948e compiled with new rustc 2018-03-24 09:36:25 -07:00
Jeff Wu
e371e2f112 add nthreads option, histogram 2016-03-17 23:10:38 -07:00
Jeff Wu
7f5feacbc7 command line parsing 2016-03-13 18:11:20 -07:00
Jeff Wu
55e9dc2fe3 add some logging, fix some bugs 2016-03-06 01:35:19 -08:00
Jeff Wu
9508a20082 flushed out game initialization 2016-03-05 19:36:02 -08:00
Jeff Wu
4168800875 Initial commit 2016-03-05 16:54:46 -08:00