Giter Site home page Giter Site logo

Comments (3)

benjaminpjones avatar benjaminpjones commented on May 23, 2024

It's a bit complicated in that some types of variants (like parallel) may not want to have ko evaluated every move. I am now leaning toward a Ko-detector object that will throw if Ko is detected. This fits in with the throw-on-illegal-move paradigm we work with currently, and it's composable.

example:

const ko_detector = new KoDetector();
ko_detector.push({ a: 1 })
ko_detector.push({ a: 2 })
ko_detector.push({ a: 1 }) // KoError: board state repeated

from govariants.

JonKo314 avatar JonKo314 commented on May 23, 2024

Game state repetitions will be a problem in many variants. In parallel go they just look different. Instead of going back and forth like in a baduk ko, there might be no progress at all. Examples:

  • Collisions that result in passes
  • All placed stones are captured immediately

But we can always extend the base class with some shared repetition detection and inherit from that extension wherever it is convenient (or find other ways to reuse code).

from govariants.

benjaminpjones avatar benjaminpjones commented on May 23, 2024

Yep, I agree that ko will be needed in many variants. Feel free to open an issue for the ones that still need it! (parallel and maybe @merowin 's graph variant?)

I've tried to make KoDetector is relatively reusable:

  • it is basically a 2-liner (one line for initialization and another for pushing state)
  • can be placed anywhere
  • each variant has full control over which subset of the state is relevant.

from govariants.

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.