[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 2c5e356 107/357: [gnugo maint] Add some debugging
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 2c5e356 107/357: [gnugo maint] Add some debugging aids to HACKING; nfc. |
Date: |
Sun, 29 Nov 2020 14:51:00 -0500 (EST) |
branch: externals/gnugo
commit 2c5e3567c7fa5db610e272ea0f7798921fb349a1
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo maint] Add some debugging aids to HACKING; nfc.
---
HACKING | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/HACKING b/HACKING
index c0e05c4..f096de8 100644
--- a/HACKING
+++ b/HACKING
@@ -11,6 +11,37 @@ This file is both a guide for newcomers and a todo list for
oldstayers.
*** [[file:gnugo.el::defun.gnugo-toggle-dead-group][gnugo-toggle-dead-group]]
only half-complete
*** no error-handling in SGF parsing
*** performance -- ‘compare-strings’ approach too clever/slow :-/
+* debugging aids
+*** swizzling branches for frolicking fun
+(defun SWIZ (a b)
+ (let* ((tree (gnugo-get :sgf-gametree))
+ (monkey (gnugo-get :monkey))
+ (bidx (aref monkey 1)))
+ (rotatef (aref tree a)
+ (aref tree b))
+ (cond ((= a bidx) (aset monkey 1 b))
+ ((= b bidx) (aset monkey 1 a)))))
+
+(defun SWIZ-RANDOM ()
+ (interactive)
+ (let* ((n (length (gnugo-get :sgf-gametree)))
+ (one (random n))
+ (two (if (= 1 n)
+ one
+ (loop with try
+ while (= one (setq try (random n)))
+ finally return try))))
+ (SWIZ one two)
+ (message "%d <-> %d" one two)))
+
+(defun UNSWIZ ()
+ (interactive)
+ (let* ((monkey (gnugo-get :monkey))
+ (cur (aref monkey 1)))
+ (if (zerop cur)
+ (message "(nothing to do)")
+ (SWIZ 0 cur)
+ (message "0 <-> %d" cur))))
* ideas / wishlist
*** set ‘lexical-binding’ (if possible!)
Hmm, lots of symbol trickery going on; initial attempts FAIL.
- [elpa] externals/gnugo 35b1551 091/357: [gnugo int] Use ‘loop’ instead of ‘mapc’ + ‘apply’., (continued)
- [elpa] externals/gnugo 35b1551 091/357: [gnugo int] Use ‘loop’ instead of ‘mapc’ + ‘apply’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b5990a0 085/357: [gnugo int] Use ‘gnugo-treeroot’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f9668f0 090/357: [gnugo int] Add abstraction: gnugo--blackp, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c164c40 092/357: [gnugo int] Add abstraction: gnugo--passp, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bf04735 094/357: [gnugo] Fix bug: Don't misuse SGF prop ‘:EV’ for "resign" state., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e036fed 096/357: [gnugo] Fix bug: On load, follow mainline through subtrees., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eaaa7c8 102/357: [gnugo int] Invert gametree IR to hang by the leaves., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ed11a74 101/357: [gnugo int] Embrace (NODE[...] [SUBTREE...]) IR, for now., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b7843bf 103/357: [gnugo maint] Move hi-lock hint from NEWS to HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ae888ba 105/357: [gnugo] Add command ‘gnugo-oops’ and keybinding., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2c5e356 107/357: [gnugo maint] Add some debugging aids to HACKING; nfc.,
Stefan Monnier <=
- [elpa] externals/gnugo a708759 110/357: [gnugo int] Use ‘cl-labels’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a35f657 115/357: [gnugo] Support SGF[4] parsing from string data., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3d8db48 119/357: [gnugo] Declare dependency on ‘ascii-art-to-unicode’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4b866c7 127/357: [gnugo int] Avoid lower move-num candidates in déjà-vu search., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5b51e4f 129/357: [gnugo int] Decruft: Consolidate "breathe in" loops., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo fda0ca5 130/357: [gnugo int] Move precise fanout computation to "breathe in"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cbf99df 131/357: [gnugo int] Insert frolic xrep starting w/ the leaves., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5c87b11 141/357: [gnugo frolic int] Use ‘move-to-column’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d62412f 144/357: [gnugo int] Add abstraction: gnugo--move-to-bcol, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4680536 143/357: [gnugo int] Fix bug: Unbreak SGF file output., Stefan Monnier, 2020/11/29