[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 0839611f42 108/472: Refactor out pacmacs--make-boa
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 0839611f42 108/472: Refactor out pacmacs--make-board function (#74) |
Date: |
Thu, 6 Jan 2022 21:59:17 -0500 (EST) |
branch: elpa/pacmacs
commit 0839611f42d68566050a8137a2a24d5f71051a2e
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Refactor out pacmacs--make-board function (#74)
---
pacmacs-board.el | 43 ++++++++++++++++++++++
pacmacs.el | 11 ++----
test/{pacman-anim-test.el => pacmacs-anim-test.el} | 0
test/pacmacs-board-test.el | 9 +++++
...{pacman-image-test.el => pacmacs-image-test.el} | 0
test/pacmacs-test.el | 11 ------
...{pacman-utils-test.el => pacmacs-utils-test.el} | 0
7 files changed, 55 insertions(+), 19 deletions(-)
diff --git a/pacmacs-board.el b/pacmacs-board.el
new file mode 100644
index 0000000000..ad876c5a83
--- /dev/null
+++ b/pacmacs-board.el
@@ -0,0 +1,43 @@
+;;; pacmacs-board.el --- Pacman for Emacs
+
+;; Copyright (C) 2015 Codingteam
+
+;; Author: Codingteam <codingteam@conference.jabber.ru>
+;; Maintainer: Alexey Kutepov <reximkut@gmail.com>
+;; URL: http://github.com/rexim/pacmacs.el
+
+;; Permission is hereby granted, free of charge, to any person
+;; obtaining a copy of this software and associated documentation
+;; files (the "Software"), to deal in the Software without
+;; restriction, including without limitation the rights to use, copy,
+;; modify, merge, publish, distribute, sublicense, and/or sell copies
+;; of the Software, and to permit persons to whom the Software is
+;; furnished to do so, subject to the following conditions:
+
+;; The above copyright notice and this permission notice shall be
+;; included in all copies or substantial portions of the Software.
+
+;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+;; SOFTWARE.
+
+;;; Commentary:
+
+;; Routines for working with board
+
+;;; Code:
+
+(defun pacmacs--make-board (width height)
+ (let ((board (make-vector height nil)))
+ (dotimes (row height)
+ (aset board row (make-vector width nil)))
+ board))
+
+(provide 'pacmacs-board)
+
+;;; pacmacs-board.el ends here
diff --git a/pacmacs.el b/pacmacs.el
index 3d21f5447e..be7ca5b149 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -38,6 +38,7 @@
(require 'dash)
(require 'pacmacs-anim)
+(require 'pacmacs-board)
(require 'pacmacs-image)
(require 'pacmacs-utils)
@@ -133,12 +134,6 @@
:speed 0
:speed-counter 0))
-(defun pacmacs--init-board (width height)
- (let ((board (make-vector height nil)))
- (dotimes (row height)
- (aset board row (make-vector width nil)))
- board))
-
(defun pacmacs--kill-buffer-and-its-window (buffer-or-name)
(let ((buffer-window (get-buffer-window buffer-or-name)))
(if (and buffer-window
@@ -390,9 +385,9 @@
(setq pacmacs-board-width board-width)
(setq pacmacs-board-height board-height)
- (setq pacmacs-board (pacmacs--init-board pacmacs-board-width
+ (setq pacmacs-board (pacmacs--make-board pacmacs-board-width
pacmacs-board-height))
- (setq pacmacs-track-board (pacmacs--init-board pacmacs-board-width
+ (setq pacmacs-track-board (pacmacs--make-board pacmacs-board-width
pacmacs-board-height))
(setq pacmacs-wall-cells nil)
diff --git a/test/pacman-anim-test.el b/test/pacmacs-anim-test.el
similarity index 100%
rename from test/pacman-anim-test.el
rename to test/pacmacs-anim-test.el
diff --git a/test/pacmacs-board-test.el b/test/pacmacs-board-test.el
new file mode 100644
index 0000000000..b390281829
--- /dev/null
+++ b/test/pacmacs-board-test.el
@@ -0,0 +1,9 @@
+(ert-deftest pacmacs--make-board-test ()
+ (let ((width 5)
+ (height 4)
+ (expected-board [[nil nil nil nil nil]
+ [nil nil nil nil nil]
+ [nil nil nil nil nil]
+ [nil nil nil nil nil]]))
+ (should (equal expected-board
+ (pacmacs--make-board width height)))))
diff --git a/test/pacman-image-test.el b/test/pacmacs-image-test.el
similarity index 100%
rename from test/pacman-image-test.el
rename to test/pacmacs-image-test.el
diff --git a/test/pacmacs-test.el b/test/pacmacs-test.el
index 4e02b4299f..8859859408 100644
--- a/test/pacmacs-test.el
+++ b/test/pacmacs-test.el
@@ -8,17 +8,6 @@
(should (equal expected-board
input-board))))
-
-(ert-deftest pacmacs--init-board-test ()
- (let ((width 5)
- (height 4)
- (expected-board [[nil nil nil nil nil]
- [nil nil nil nil nil]
- [nil nil nil nil nil]
- [nil nil nil nil nil]]))
- (should (equal expected-board
- (pacmacs--init-board width height)))))
-
(ert-deftest pacmacs--object-at-p-test ()
(let ((pacmacs-board-width 5)
(pacmacs-board-height 4)
diff --git a/test/pacman-utils-test.el b/test/pacmacs-utils-test.el
similarity index 100%
rename from test/pacman-utils-test.el
rename to test/pacmacs-utils-test.el
- [nongnu] elpa/pacmacs 07e18ca1e6 067/472: Implement pills. Close #34, (continued)
- [nongnu] elpa/pacmacs 07e18ca1e6 067/472: Implement pills. Close #34, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs ef0cd69d99 072/472: Add copyright header to pacman-utils module, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 66f585899a 080/472: Fix pacman image UTs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs f7b17f7cde 079/472: Set same background as foreground for color block. Close #59, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 28fc537f40 084/472: Multiple ghost support. Close #64, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d637985f0b 095/472: Fix BFS wraparound bug. Close #73, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 952801d94a 098/472: UT for pacmacs--fill-board-test (#75), ELPA Syncer, 2022/01/06
- [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 <=
- [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, 2022/01/06
- [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