Giter Site home page Giter Site logo

GoTo specific move number about pgn-viewer HOT 3 OPEN

mliebelt avatar mliebelt commented on September 4, 2024
GoTo specific move number

from pgn-viewer.

Comments (3)

mliebelt avatar mliebelt commented on September 4, 2024

You are right, there is no API to do something like that. I checked the API again, at the moment, you can only do manual moves from one position to the next.

So let me write down the requirement: The user should be able to jump to any position in the game denoted by the move number. The move number is denoted by the array index of the half moves done. In the game e4 e5 Nf3 Nc6 the move numbers are: 1 e4 2 e5 3 Nf3 4 Nc6.

What about variants? We cannot say which move number will be which move in which variant (at least not so simple). For the moment, this would only work for the main line.

from pgn-viewer.

mliebelt avatar mliebelt commented on September 4, 2024

There is a similar functionality already implemented, see #171 The ideas from that implementation could be moved.

Requirements would be:

  1. This works only to repeat moves already done.
  2. The moves are the moves of the main line (only). Later on, we may find a way to address moves from the variant (like in the 5th move, the 1st variant, the 3rd move == 5.v1.3. Too complicated at the moment.
  3. The moves are counted from 0 onward, so the moves of the notation 1. e4 e5 2. Nf3 Nc6 will be: 0 e4 1 e5 2 Nf3 3 Nc6.

from pgn-viewer.

mliebelt avatar mliebelt commented on September 4, 2024

Did a quick hack, there are many things missing (yet). But demonstrates that jumping to a move is not a big deal ..

from pgn-viewer.

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.