emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 03/04: [gnugo int] Reorder gametree IR: ENDS, MNUM, ROOT, KIDS.


From: Thien-Thi Nguyen
Subject: [elpa] 03/04: [gnugo int] Reorder gametree IR: ENDS, MNUM, ROOT, KIDS.
Date: Fri, 11 Apr 2014 09:25:00 +0000

ttn pushed a commit to branch master
in repository elpa.

commit e8f81e04896e2afd144bb12b3a81a9aa0dbad258
Author: Thien-Thi Nguyen <address@hidden>
Date:   Fri Apr 11 11:21:54 2014 +0200

    [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.
---
 packages/gnugo/gnugo.el |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 9279261..415ba7d 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]