[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs 1d52833fef 406/472: Add render-score-record functi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs 1d52833fef 406/472: Add render-score-record function (#134) |
Date: |
Thu, 6 Jan 2022 21:59:44 -0500 (EST) |
branch: elpa/pacmacs
commit 1d52833fefe0fb771260a4f4486502d0cc20d44f
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Add render-score-record function (#134)
---
pacmacs-score.el | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/pacmacs-score.el b/pacmacs-score.el
index df03b30f3f..84dae8c86c 100644
--- a/pacmacs-score.el
+++ b/pacmacs-score.el
@@ -78,19 +78,7 @@
(length)))
(defun pacmacs--render-score-table (score-table)
- (let ((max-nickname-length
- (->> score-table
- (-map (-compose #'length #'car))
- (apply #'max))))
- (insert "Best Scores:\n------------\n")
- (-each score-table
- (-lambda ((nickname . score))
- (insert (format "%s%s %d\n"
- nickname
- (make-string (- max-nickname-length
- (length nickname))
- ?\s)
- score))))))
+ (-each score-table #'pacmacs--render-score-record))
(defun pacmacs--add-entry-to-score-table (nickname score)
(->> (pacmacs--read-score-table)
@@ -103,6 +91,15 @@
(let ((nickname (read-from-minibuffer "Nickname: ")))
(pacmacs--add-entry-to-score-table nickname score)))
+(defun pacmacs--render-score-record (record)
+ (-let (((nickname . score) record))
+ (insert (format "%s%s %d\n"
+ nickname
+ (make-string (- pacmacs--max-score-nick-size
+ (length nickname))
+ ?\s)
+ score))))
+
(provide 'pacmacs-score)
;;; pacmacs-score.el ends here
- [nongnu] elpa/pacmacs 612d7ff1dd 297/472: UT for pacmacs--decrease-terrified-timers (#153), (continued)
- [nongnu] elpa/pacmacs 612d7ff1dd 297/472: UT for pacmacs--decrease-terrified-timers (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 4ab8f5d799 300/472: Unbind replace-game-objects from glob lists (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 4396ec7412 315/472: Fix FIXME in handle-ghost-blinking-threshold, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 5f3fbbab5a 319/472: Introduce distance based tracking (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 784b5c60e4 350/472: Merge pull request #177 from codingteam/qfix/broken-att-script, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b7a57c2d8e 353/472: Remove w/o BP tutorial level (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 4ce9773129 365/472: Merge pull request #183 from codingteam/push-instead-of-add-to-list-182, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 25e1fc9f85 369/472: Interactive function to clean wall cache (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b8ad3a5421 370/472: Fix game over sign (#138), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 78be23ea40 392/472: Remove make-terrifed-ghost function, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 1d52833fef 406/472: Add render-score-record function (#134),
ELPA Syncer <=
- [nongnu] elpa/pacmacs bd030753f0 411/472: Reset pacmacs-score to 0 (#134), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 542e38a612 429/472: Fix README for sprites folder, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 7f980e59a4 435/472: Load game-over sign from signs folder (#191), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs b7caafa647 436/472: Merge pull request #200 from codingteam/customize-level-folder-191, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs f174ccb540 438/472: Enable truncate-lines for Game Over page (#201), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs bc62e40d25 444/472: Make rendering more reusable (#203), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 314809f2a7 443/472: Merge branch 'master' into feature/awesome-score-sign-203, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 5f12be8d33 450/472: Move render-object-board to pacmacs-render module, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 929b367fa2 453/472: Make render-score-table more dumb (#203), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 548155de50 456/472: Dash the mode labels (#203), ELPA Syncer, 2022/01/06