[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 9cb186f10a 137/472: Refactor pacmacs-inversed-dire
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 9cb186f10a 137/472: Refactor pacmacs-inversed-direction-table out. Close #103 |
Date: |
Thu, 6 Jan 2022 21:59:19 -0500 (EST) |
branch: elpa/pacmacs
commit 9cb186f10a701914543b57d871fc4129398a34db
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Refactor pacmacs-inversed-direction-table out. Close #103
---
pacmacs-utils.el | 8 ++++++++
pacmacs.el | 11 +----------
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/pacmacs-utils.el b/pacmacs-utils.el
index 9d649bcb5a..f8301b5b62 100644
--- a/pacmacs-utils.el
+++ b/pacmacs-utils.el
@@ -57,6 +57,14 @@ side-effects."
'down (cons 1 0))))
(plist-get direction-table direction)))
+(defun pacmacs--direction-name (direction-vector)
+ (let ((direction-table '((( 0 . -1) . left)
+ (( 0 . 1) . right)
+ ((-1 . 0) . up)
+ (( 1 . 0) . down))))
+ (cdr (assoc direction-vector
+ direction-table))))
+
(provide 'pacmacs-utils)
;;; pacmacs.el ends here
diff --git a/pacmacs.el b/pacmacs.el
index 278f92a241..41de38e4ef 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -53,13 +53,6 @@
(defvar pacmacs-board-height 10)
(defvar pacmacs-score 0)
-(defvar pacmacs-inversed-direction-table nil)
-(setq pacmacs-inversed-direction-table
- (list (cons (cons -1 0) 'left)
- (cons (cons 1 0) 'right)
- (cons (cons 0 -1) 'up)
- (cons (cons 0 1) 'down)))
-
(defvar pacmacs-player-state nil)
(defvar pacmacs-ghosts nil)
@@ -260,9 +253,7 @@
(pacmacs--cell-set pacmacs-track-board
start-row start-column
- (cdr
- (assoc (cons d-column d-row)
- pacmacs-inversed-direction-table)))))
+ (pacmacs--direction-name (cons d-row d-column)))))
(defun pacmacs--recalc-track-board ()
(pacmacs--fill-board pacmacs-track-board nil)
- [nongnu] elpa/pacmacs 428b994240 096/472: Remove debug output stuff, (continued)
- [nongnu] elpa/pacmacs 428b994240 096/472: Remove debug output stuff, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9614f394e7 106/472: Merge branch 'board-functions-uts-75'. Close #75, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1e29c2f943 101/472: UTs for pacmacs--cell-tracked-p (#75), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0839611f42 108/472: Refactor out pacmacs--make-board function (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 8aa9d50dda 102/472: Remove pacmacs--within-of-map-p (#75), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7714743aa8 103/472: UTs for pacmacs--track-point (#75), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2c0bcf993f 107/472: Use two-argumented `<=`. Close #76, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e5bd77740d 119/472: Fix NPEs (#74), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 286eb99ae0 130/472: Implement prepare phase. Close #80, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d14cdd38e3 135/472: Fix last eaten pill visibility. Close #96, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9cb186f10a 137/472: Refactor pacmacs-inversed-direction-table out. Close #103,
ELPA Syncer <=
- [nongnu] elpa/pacmacs 91c317819c 123/472: Implement basic death mechanics (#69), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs be91d566cb 139/472: Implement Game Over state. Close #94, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b8cd22229d 142/472: Introduce pacmacs--anim-object-list-next-frame, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 91e432111b 145/472: Implement basic score table mechnism (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7058b61e47 146/472: Implement adding entries to score table (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs e032089ab4 151/472: Render score table on Game Over screen (#92), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs a7b0530f65 152/472: Merge branch 'score-table-92'. Close #92, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1b2ca64cd1 157/472: Merge branch 'resource-packaging-95'. Close #95, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 48ecc5cee9 159/472: Don't fail if the score file doesn't exist, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 10b8a997dd 037/472: More precise instructions in README, ELPA Syncer, 2022/01/06