[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 89d10e4 159/357: [gnugo int] Reorder gametree IR:
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 89d10e4 159/357: [gnugo int] Reorder gametree IR: ENDS, MNUM, ROOT, KIDS. |
Date: |
Sun, 29 Nov 2020 14:51:12 -0500 (EST) |
branch: externals/gnugo
commit 89d10e449d60cc0060cba13478473da83a6f1180
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Reorder gametree IR: ENDS, MNUM, ROOT, KIDS.
* packages/gnugo/gnugo.el (gnugo--tree-mnum)
(gnugo--tree-ends, gnugo--set-tree-ends)
(gnugo-describe-internal-properties, gnugo--root-node)
(gnugo/sgf-create): ...here.
---
gnugo.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 9279261..415ba7d 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -254,13 +254,13 @@ See `gnugo-put'."
(gethash key gnugo-state))
(defsubst gnugo--tree-mnum (tree)
- (aref tree 0))
+ (aref tree 1))
(defsubst gnugo--tree-ends (tree)
- (aref tree 2))
+ (aref tree 0))
(defsubst gnugo--set-tree-ends (tree ls)
- (aset tree 2 (apply 'vector ls))
+ (aset tree 0 (apply 'vector ls))
(gnugo--tree-ends tree))
(defun gnugo-describe-internal-properties ()
@@ -284,7 +284,7 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
(list (hash-table-count
(gnugo--tree-mnum val))
(hash-table-count
- (aref val 1))
+ (aref val 3))
(gnugo--tree-ends val)))
(:monkey
(let ((mem (aref val 0)))
@@ -404,7 +404,7 @@ when you are sure the command cannot fail."
(defun gnugo--root-node (&optional tree)
(aref (or tree (gnugo-get :sgf-gametree))
- 3))
+ 2))
(defsubst gnugo--root-prop (prop &optional tree)
(cdr (assq prop (gnugo--root-node tree))))
@@ -2571,15 +2571,15 @@ Optional arg DATA-P non-nil means FILE-OR-DATA is
a string containing SGF[4] data.
A collection is a list of gametrees, each a vector of four elements:
+ ENDS -- a vector of node lists, with shared tails
+ (last element of all the lists is the root node)
+
MNUM -- `eq' hash: node to move numbers; non-\"move\" nodes
have a move number of the previous \"move\" node (or zero)
- KIDS -- `eq' hash: node to node list (branch points only)
-
- ENDS -- a vector of node lists, with shared tails
- (last element of all the lists is the root node)
+ ROOT -- the root node
- ROOT -- the root node"
+ KIDS -- `eq' hash: node to node list (branch points only)"
;; Arg names inspired by `create-image', despite -P being frowned upon.
(let ((keywords (or (get 'gnugo/sgf-*r4-properties* :keywords)
(put 'gnugo/sgf-*r4-properties* :keywords
@@ -2728,10 +2728,10 @@ A collection is a list of gametrees, each a vector of
four elements:
(kids (gnugo--mkht))
(ends (TREE nil mnum kids))
(root (car (last (car ends)))))
- (vector mnum
- kids
- (apply 'vector ends)
- root)))))))
+ (vector (apply 'vector ends)
+ mnum
+ root
+ kids)))))))
(defun gnugo/sgf-write-file (collection filename)
(let ((aft-newline-appreciated '(:AP :GN :PB :PW :HA :KM :RU :RE))
- [elpa] externals/gnugo e66bfa0 352/357: [gnugo int] Gate ‘cursor-intangible-mode’ call precisely, (continued)
- [elpa] externals/gnugo e66bfa0 352/357: [gnugo int] Gate ‘cursor-intangible-mode’ call precisely, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2f73382 353/357: [gnugo] Add some docstrings to some vars/funcs., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eb9748f 355/357: [gnugo maint] Update years in copyright notice; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2dd0aca 357/357: * .gitignore: New file, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ee905ef 048/357: [gnugo] Fix bug: Compute grid spacing using offset math., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 566623c 121/357: [gnugo int] Invert ‘if’ CONDITION and THEN/ELSE clauses., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 19309c3 139/357: [gnugo frolic] Handle invalid branch more consistently., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d214e7e 137/357: [gnugo frolic] Add command to set the main line., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dd42857 148/357: [gnugo frolic] Set ‘truncate-lines’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1a544a5 154/357: [gnugo int] Whitespace munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 89d10e4 159/357: [gnugo int] Reorder gametree IR: ENDS, MNUM, ROOT, KIDS.,
Stefan Monnier <=
- [elpa] externals/gnugo bba08d3 158/357: [gnugo sgf int] Internalize ‘gnugo/sgf-hang-from-root’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2f09438 145/357: [gnugo int] Fix syntax error., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0eede2a 175/357: [gnugo int] Add abstraction: gnugo--count-query, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8a064c5 184/357: [gnugo int] Incorporate *-play-stone into ‘gnugo-push-move’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ee09531 192/357: [gnugo] New command: ‘S’ (gnugo-request-suggestion), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bc92d6d 202/357: [gnugo frolic] Type ‘Q’ to quit., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a3baa99 200/357: [gnugo int] Use ‘following-char’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e644695 203/357: [gnugo] Increase S/N for ‘C-u F’ comment., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7b29f73 219/357: [gnugo int] Decruft: Don't stash :proc-args., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 12d3d80 216/357: [gnugo] Keep GNUGO Board buffer read-only., Stefan Monnier, 2020/11/29