[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 62bcd78913 243/472: Refactor possible ways functio
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 62bcd78913 243/472: Refactor possible ways functions (#131): |
Date: |
Thu, 6 Jan 2022 21:59:28 -0500 (EST) |
branch: elpa/pacmacs
commit 62bcd7891331efbb06cc12ec14fe2d2c26c5c2d9
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Refactor possible ways functions (#131):
- Rename possible-ways function to possible-side-ways
- Introduce possible-diagonal-ways function
---
pacmacs.el | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/pacmacs.el b/pacmacs.el
index 61fe4e964d..bf73ce8517 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -242,12 +242,18 @@
(pacmacs--put-object game-object)))
(plist-put game-object :speed-counter (1- speed-counter)))))
-(defun pacmacs--possible-ways (row column)
+(defun pacmacs--possible-side-ways (row column)
(list (cons (1+ row) column) ;down
(cons row (1+ column)) ;right
(cons (1- row) column) ;up
(cons row (1- column)))) ;left
+(defun pacmacs--possible-diagonal-ways (row column)
+ (list (cons (1- row) (1- column))
+ (cons (1- row) (1+ column))
+ (cons (1+ row) (1- column))
+ (cons (1+ row) (1+ column))))
+
(defun pacmacs--filter-candidates (p)
(let ((row (car p))
(column (cdr p)))
@@ -279,7 +285,7 @@
(dolist (p wave)
(let* ((row (car p))
(column (cdr p))
- (possible-ways (pacmacs--possible-ways row column))
+ (possible-ways (pacmacs--possible-side-ways row column))
(candidate-ways
(cl-remove-if #'pacmacs--filter-candidates possible-ways)))
(dolist (candidate-way candidate-ways)
@@ -549,11 +555,8 @@
40 40 "#5555ff"
(-map (-lambda ((row . column))
(not (pacmacs--wall-at-p
row column)))
- (append
(pacmacs--possible-ways row column)
- (list (cons (1-
row) (1- column))
- (cons (1-
row) (1+ column))
- (cons (1+
row) (1- column))
- (cons (1+
row) (1+ column))))))))))))
+ (append
(pacmacs--possible-side-ways row column)
+
(pacmacs--possible-diagonal-ways row column))))))))))
(provide 'pacmacs)
- [nongnu] elpa/pacmacs a8bbb61bf8 189/472: Try to remove elcs after the compilation (#124), (continued)
- [nongnu] elpa/pacmacs a8bbb61bf8 189/472: Try to remove elcs after the compilation (#124), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7729f08230 196/472: Rename render-board to object-board (#126), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs cede2ffb48 202/472: Optimize object look up (#126):, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9e29a7aa19 207/472: Add information about cask install., ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs c6ddeab3f2 215/472: Roughly implement it replayer (#122), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 17a82dffec 205/472: Add UT for object-type-at-p, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ce03d91967 227/472: Introduce xbm flip bit hack (#133), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b0bc866a7b 218/472: Measure tick time during replay (#122), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 6f55a2df10 236/472: Add UT for pacmacs--put-bits-dot function (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 48dacba354 238/472: Refactor wall generator with bar functions (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 62bcd78913 243/472: Refactor possible ways functions (#131):,
ELPA Syncer <=
- [nongnu] elpa/pacmacs c2303269c0 249/472: Drop XBM support for empty cells (#141), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0f403095f0 265/472: Update README after repo transferring (#140), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 169cd54064 269/472: Add UT for pacmacs--bit-list-to-integer, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 769414fae0 274/472: Extend pacmacs--normalize-wall-bits UT, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d8a7998192 277/472: Extract `cask install` to separate step in README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 614a98ccc7 278/472: Cleanup README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs fa6eca1731 284/472: Introduce list for terrified ghost objects (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 701da0f16c 285/472: Rename direction switching callbacks (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs cfa4437107 292/472: Implement eating terrified ghosts (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ece3e76f30 296/472: Rename run-away-direction arguments (#153), ELPA Syncer, 2022/01/06