[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 71f163d 111/357: [gnugo int] Support growth also
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 71f163d 111/357: [gnugo int] Support growth also off of main line. |
Date: |
Sun, 29 Nov 2020 14:51:01 -0500 (EST) |
branch: externals/gnugo
commit 71f163d8efab02d2aad837072afc251261f4857b
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Support growth also off of main line.
* packages/gnugo/gnugo.el (gnugo-note):
For déjà-vu check, don't start w/ ‘bidx’ if no regrets;
also, copy the old branch immediately to its right,
instead of placing it at the end of the ends vector.
---
gnugo.el | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index a58313b..ca8042a 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -953,22 +953,21 @@ are dimmed. The buffer is in View minor mode."
;; X---Y---A new
;; \
;; --B old
- ;;
- ;; This presumes ‘bidx’ is 0 (main line) and that
- ;; all growth should occur on the main line.
(cl-flet
((continue-on (bx)
(rotatef (aref tree bidx)
(aref tree bx))))
- ;; ugh, quadratic
(loop
with count = (length tree)
with (bx previous)
for i
;; Start with latest / highest likelihood for hit.
;; todo: prune unfeasible candidates
- from 0 above (- count)
- if (setq bx (mod i count)
+ from (if (gnugo--no-regrets monkey tree)
+ 1
+ 0)
+ below count
+ if (setq bx (mod (+ bidx i) count)
previous
;; todo: early termination based on move number
(loop for m on (aref tree bx)
@@ -993,8 +992,10 @@ are dimmed. The buffer is in View minor mode."
;; <grumble grumble> SGF sez "move" node in the root
;; position of a (sub-)gametree is "bad style". :-/
(let ((where (memq tree (gnugo-get :sgf-collection))))
- (setq tree (apply 'vector (append tree (list mem))))
- (continue-on count)
+ (setq tree (let ((ls (append tree nil)))
+ ;; copy old to the right of new
+ (push mem (nthcdr bidx ls))
+ (apply 'vector ls)))
(gnugo-put :sgf-gametree tree)
(setcar where tree)))
(push fruit mem)
- [elpa] externals/gnugo 4f96ca6 076/357: [gnugo sgf int] Add abstractions: seek, seek-into, (continued)
- [elpa] externals/gnugo 4f96ca6 076/357: [gnugo sgf int] Add abstractions: seek, seek-into, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 98414ca 086/357: [gnugo int] Add abstractions: gnugo{--root-node, /sgf-root-node}, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 622b1eb 084/357: [gnugo] Handle ‘(gnugo-move-history 'two)’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 06586e9 093/357: [gnugo] Fix bug: Don't bother translating move "resign"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7f380e4 006/357: [gnugo] Presume working time-date.el., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 74b839a 066/357: [gnugo int] Use ‘incf’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ad774f4 074/357: [gnugo sgf] Move gratuitous newline from after to before (sub)trees., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a44da1b 073/357: [gnugo sgf int] Add abstractions: >>prop, >>node, >>tree, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a7f01be 083/357: [gnugo int] Add abstraction: nn, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a07cf7c 109/357: [gnugo int] Use ‘gnugo--as-pos-func’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 71f163d 111/357: [gnugo int] Support growth also off of main line.,
Stefan Monnier <=
- [elpa] externals/gnugo 0b08017 114/357: [gnugo int] Avoid double list-reverse., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 08c3378 116/357: [gnugo int] Use ‘gnugo/sgf-create’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 44c2dc4 118/357: [gnugo int] Make ‘gnugo--no-regrets’ take ENDS directly., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7705eca 126/357: [gnugo int] Drop :monkey COUNT; use node's tree MNUM directly., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4b24b56 142/357: [gnugo frolic int] Don't go through ‘gnugo-frolic-quit’ for refresh., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dfc130d 136/357: [gnugo frolic] Add backward/forward branch navigation commands., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e75eb8a 135/357: [gnugo frolic] Add some branch swizzling commands., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f279f99 146/357: [gnugo frolic int] Regularize keymap decl + init., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f810771 162/357: [gnugo int] Decruft: Delete unused local vars., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b0d3543 171/357: fixup! [gnugo frolic] Add previous/next move navigation commands., Stefan Monnier, 2020/11/29