Giter Site home page Giter Site logo

Implement Embargo about dominiate HOT 1 OPEN

rspeer avatar rspeer commented on September 13, 2024
Implement Embargo

from dominiate.

Comments (1)

vote539 avatar vote539 commented on September 13, 2024

Hello,

I'm new here, but I've been playing Dominion for about a year and keep up on DominionStrategy.com. Since I recently learned the ins and outs of CoffeeScript, I thought I could contribute to Dominate.

I was thinking about the best way to implement Embargo without being psychic like in Geronimoo's simulator. There are a few obvious ways that I can think of, the first of which would probably be easier to implement than the others:

  1. Add a decision to choose the card to embargo, like the decisions to trash, discardHand, etc, in basicAI.coffee. By default, the decision would choose the most expensive card not in the AI's gainPriority method. (I don't know how we could "search" gainPriority seeing that it does not return all possible priorities, given the game state.) More intricate AIs would specify a custom embargoPriority() method.
  2. Look at the cards that other players have bought, and embargo those. This could possibly done by looking at the size of the current stacks, such as by defining a method on State called getSmallestStack:
getSmallestStack: (omissions) ->
  supplyByCount = sortNumericAssociative(@supply.slice(0)) # we'd define sortNumericAssociative similar to how sortNumeric is defined
  for card of supplyByCount
    return card if card.name not in omissions

getSmallestStack() would be called in embargoPriority(), and omissions would pass the value of @gainPriority:

embargoPriority: (state, my) ->
  state.getSmallestStack my.gainPriority

Again, we'd somehow have to solve the problem of my.gainPriority not returning all future gains.

Thoughts?

I've forked Dominate and will start working on it as soon as I work out some kinks (see my other post).

from dominiate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.