Giter Site home page Giter Site logo

Move depth property about sgfparser HOT 6 CLOSED

trevoke avatar trevoke commented on May 23, 2024
Move depth property

from sgfparser.

Comments (6)

Trevoke avatar Trevoke commented on May 23, 2024

Do you suggest that slices and enumerations be limited to the branch
on which you are, or that they include all the variations therein?
Imagine this:
0 1 2 3
2 3 4

slice = object[1..3]
Now.. Does slice mean
1 2 3
2 3

Or does it mean just
1 2 3

Or ... What does it mean?

The same question applies to enumeration. What do you suggest?

On Mon, Dec 5, 2011 at 02:43, Colin Noga
[email protected]
wrote:

The SGF format is move independent, but human logic is not. A move depth property shoudl be available for each node, specifying it’s depth from root. This is analogous to ‘move number’, as it is equivalent to the position if the node from the root (move 0).

Adding bonus properties like slices, or enumerations based on these would be delicious, delicious frosting on the cake of usability.


Reply to this email directly or view it on GitHub:
#12

from sgfparser.

Tempus avatar Tempus commented on May 23, 2024

Slices should act in a ruby-like way, exactly as they do with strings or arrays. In a different issue, I suggested adding a third class to game and tree called branch, for a branch within a game (which I believe is possible, no?). See Issue #11

In that case, a slice of a GameBranch should return only that branch. A slice of a GameTree or SgfTree should return all branches, it seems. Likewise, SgfTree.main[slice] would return a single branch of the main branch.

For the sake of simplicity, we could also only allow slicing for a single branch, avoiding variation trouble. But the above scenario would be superior.

Use cases:
Imagine, for example, a users wanting to comprise an compilation of opening database from the first 50 moves of pro games. He could simply go... SgfTree[0,50] to grab it for each game. Now imagine someone checking if anyone ever played the 2-6 point as an opening move on the second move. This could be done with SgfTree[2], and magically you would have every node in all those games to iterate over, to check for your 2-6. Other uses might be checking for tags, such as the old clan system on KGS used -> in order for games to qualify, you needed to add a specific tag before a specific move. Slices would facilitate this.

from sgfparser.

Trevoke avatar Trevoke commented on May 23, 2024

Okay. Here's another question.

Imagine I have a game like this:

 0 1 2 3 4
   1 2 3 4 5
      2 3 4 5
      2 3
      2 3 4

Clearly, that's five branches.. Right? What would be inside those branches?

 0 1 2 3 4
    1 2 3 4 5
       2 3 4 5
       2 3
       2 3 4

Or would it create this:

0 1 2 3 4
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3
0 1 2 3 4

?

from sgfparser.

Trevoke avatar Trevoke commented on May 23, 2024

Poke @Tempus -- I think I can implement this but I would like some feedback from you on a previous comment on this issue :)

from sgfparser.

Trevoke avatar Trevoke commented on May 23, 2024

poke @Tempus so it doesn't matter that the resulting slices might be completely meaningless fragments of games, right?

from sgfparser.

Trevoke avatar Trevoke commented on May 23, 2024

Depth has been implemented.

Slicing has been at least partially implemented.

from sgfparser.

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.