[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 23/255: more complex but more intuitive and useful `range'
From: |
Eric Schulte |
Subject: |
[elpa] 23/255: more complex but more intuitive and useful `range' |
Date: |
Sun, 16 Mar 2014 01:02:12 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 47a39c1be1d035f2ce75bf32aa97c1040aa6b66f
Author: Eric Schulte <address@hidden>
Date: Tue May 15 19:50:30 2012 -0400
more complex but more intuitive and useful `range'
---
sgf.el | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/sgf.el b/sgf.el
index ed6d0fe..712b6fb 100644
--- a/sgf.el
+++ b/sgf.el
@@ -208,7 +208,17 @@
(defun board-size (board) (round (sqrt (length board))))
-(defun range (size) (number-sequence 0 (- size 1)))
+(defun range (a &optional b)
+ (block nil
+ (let (tmp)
+ (unless b
+ (cond ((> a 0) (decf a))
+ ((= a 0) (return nil))
+ ((> 0 a) (incf a)))
+ (setq b a a 0))
+ (if (> a b) (setq tmp a a b b tmp))
+ (let ((res (number-sequence a b)))
+ (if tmp (nreverse res) res)))))
(defvar black-piece "X")
- [elpa] 12/255: headers, (continued)
- [elpa] 12/255: headers, Eric Schulte, 2014/03/15
- [elpa] 15/255: board display, Eric Schulte, 2014/03/15
- [elpa] 22/255: example sgf file generated using gcoban, Eric Schulte, 2014/03/15
- [elpa] 17/255: not using "I" as an index, Eric Schulte, 2014/03/15
- [elpa] 20/255: alright "i" *is* a valid position identifier, Eric Schulte, 2014/03/15
- [elpa] 16/255: cleaned up board printing, Eric Schulte, 2014/03/15
- [elpa] 09/255: parsing more complex trees, Eric Schulte, 2014/03/15
- [elpa] 19/255: moving games/ -> sgf-files/, Eric Schulte, 2014/03/15
- [elpa] 10/255: helper functions, Eric Schulte, 2014/03/15
- [elpa] 24/255: right and left implemented but buggy, Eric Schulte, 2014/03/15
- [elpa] 23/255: more complex but more intuitive and useful `range',
Eric Schulte <=
- [elpa] 21/255: display sgf file as a go board in a buffer, Eric Schulte, 2014/03/15
- [elpa] 25/255: right and left are mainly working, Eric Schulte, 2014/03/15
- [elpa] 29/255: q now quits a sgf display buffer, Eric Schulte, 2014/03/15
- [elpa] 28/255: adding a major mode for board navigation keys, Eric Schulte, 2014/03/15
- [elpa] 27/255: implementation notes, Eric Schulte, 2014/03/15
- [elpa] 31/255: a test to protect against unwanted state changes, Eric Schulte, 2014/03/15
- [elpa] 33/255: removing dead pieces after moves, Eric Schulte, 2014/03/15
- [elpa] 35/255: compiled and caught some minor issues, Eric Schulte, 2014/03/15
- [elpa] 32/255: consolidating utility functions, Eric Schulte, 2014/03/15
- [elpa] 30/255: saving the board configuration with each sgf step, Eric Schulte, 2014/03/15