[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/13: [gnugo int] Add abstraction: gnugo--prop<-color
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 01/13: [gnugo int] Add abstraction: gnugo--prop<-color |
Date: |
Mon, 21 Apr 2014 21:32:08 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit 8bacf43138d31da7354a62a4eb3647749b1235fb
Author: Thien-Thi Nguyen <address@hidden>
Date: Sun Apr 20 13:09:48 2014 +0200
[gnugo int] Add abstraction: gnugo--prop<-color
* packages/gnugo/gnugo.el (gnugo--prop<-color): New defsubst.
(gnugo-push-move, gnugo-okay): Use ‘gnugo--prop<-color’.
---
packages/gnugo/gnugo.el | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 5ce9564..e4774c4 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -344,6 +344,9 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
"Return the current player, either \"black\" or \"white\"."
(gnugo-other (gnugo-get :last-mover)))
+(defsubst gnugo--prop<-color (color)
+ (if (gnugo--blackp color) :B :W))
+
(defsubst gnugo--gate-game-over (enable)
(when (and enable (gnugo-get :game-over))
(user-error "Sorry, game over")))
@@ -1282,8 +1285,7 @@ This fails if the monkey is on the current branch
(string= ucolor color))
(gnugo-put :last-user-bpos (and (not passp) (not resignp) move)))
;; update :sgf-gametree and :monkey
- (let* ((property (if (gnugo--blackp color)
- :B :W))
+ (let* ((property (gnugo--prop<-color color))
(pair (cons property (cond (resignp move)
(passp "")
(t (funcall (gnugo--as-cc-func)
@@ -2047,8 +2049,7 @@ Prefix arg means to redo all the undone moves."
(bidx (aref monkey 1))
(end (aref ends bidx))
(ucolor (gnugo-get :user-color))
- (uprop (if (gnugo--blackp ucolor)
- :B :W)))
+ (uprop (gnugo--prop<-color ucolor)))
(cl-flet ((mvno (node) (gethash node mnum)))
(loop
with ok = (if full
- [elpa] branch master updated (1905244 -> a1fe7f0), Thien-Thi Nguyen, 2014/04/21
- [elpa] 01/13: [gnugo int] Add abstraction: gnugo--prop<-color,
Thien-Thi Nguyen <=
- [elpa] 03/13: [gnugo int] Fix bug: On -l/--infile, don't set :last-mover., Thien-Thi Nguyen, 2014/04/21
- [elpa] 04/13: [gnugo int] Fix bug: On -l/--infile, inhibit first move if game over., Thien-Thi Nguyen, 2014/04/21
- [elpa] 05/13: [gnugo] Fix bug: DTRT for :last-user-bpos in undo-one-move ME-NEXT., Thien-Thi Nguyen, 2014/04/21
- [elpa] 06/13: [gnugo] Reduce modifier key bouncing for "quick peek" frolics., Thien-Thi Nguyen, 2014/04/21
- [elpa] 09/13: [gnugo] Validate position arg of GTP commands ‘undo’, ‘gg-undo’., Thien-Thi Nguyen, 2014/04/21
- [elpa] 08/13: [gnugo int] Add abstraction: gnugo--mem-with-played-stone, Thien-Thi Nguyen, 2014/04/21
- [elpa] 07/13: [gnugo int] Add abstraction: gnugo--q/ue, Thien-Thi Nguyen, 2014/04/21
- [elpa] 10/13: [gnugo] Internalize ‘g nugo-magic-undo’., Thien-Thi Nguyen, 2014/04/21
- [elpa] 11/13: [gnugo int] Simplify towards-root loop termination check., Thien-Thi Nguyen, 2014/04/21
- [elpa] 13/13: [gnugo int] Move ‘gnug o-position’ call down-chain., Thien-Thi Nguyen, 2014/04/21