hanabi's People
Forkers
fpvandoornhanabi's Issues
modify play datatype
The datatype play
is currently
datatype play = Discarded of card
| Played of card
| HintedSuit of player * suit * card list
| HintedRank of player * rank * card list
This has two problems:
- It is not clear which card is played/discarded when a player has two copies of the same card in their hand.
- The information which was known about the played/discarded card is lost.
I propose to replace the occurrences of card
by the rank of that card in the hand. Also, in Played
and Discarded
add fields of type info list
which represents all the clues given to that player while that card was in their hand. Concretely, the datatype will be
datatype play = Discarded of int * info list
| Played of int * info list
| HintedSuit of player * suit * int list
| HintedRank of player * rank * int list
This has as extra advantage that the fields HintedSuit
/HintedRank
don't have to be modified for the player Me
before passing the information.
A different thing: I think it would also simplify things a little bit if datatype player
(which is currently Me | Other of int
is just int
, where 0
is Me
and i+1
is Other i
)
If you agree, I can make these changes (or if you want you can do them, that's of course also fine, but then please first merge my branch personal
to avoid merge conflicts).
Separate out PlayerUtils
Many functions currently in SimplePlayer
will be shared among all PLAYER
s. These should be factored out into another structure.
Run multiple games
To compare performance of a new feature, it would be nice to run multiple games and see if the average score increases. If you run multiple games, you probably don't want the game log, but only the achieved score (or maybe only the average score of all games). It would be nice if we can just add a flag to the terminal command to specify how much games we want to play (by default 1).
memory for players
I tried adding a ref representing the memory of the players here: 52297b3
This is a summary of my approach:
val play : unit -> state -> action =
let
val m : memory ref = ref initialMemory
in
fn u => fn s =>
(...)
end
I have two problems:
- I want
initialMemory
to depend on the number of players, but it cannot take(s : state)
as argument yet. - The memory should revert to
initialMemory
between games, but I don't know how I can achieve that.
Any ideas?
Improve SimplePlayer
Although I would like to SimplePlayer
to remain fairly straightforward, there is clearly much room for improvement:
- Keep track of extra information implied by save clues, and act on it
- Can discard clued cards when they're guaranteed to be useless (
discardOldestUnclued
) - A card is also useless when unreachable (
isUseless
) - Several 5's usually end up in the discard right now
We can also collect ideas for a more complicated player:
- Finesses
- Reverse finesses
- Bluffs
- Awareness of the endgame
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.