unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: emacs-devel@gnu.org
Subject: Re: bad.el - ascii art games [package] [screenshots] [video]
Date: Sun, 29 Sep 2024 09:50:12 +0200	[thread overview]
Message-ID: <87y13a3nm3.fsf@dataswamp.org> (raw)
In-Reply-To: 877cav3xbi.fsf@dataswamp.org

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]

>> does every kind of visual object _have to_ have is own
>> data type?
>
> No, you can draw or type any way you want, as long as you
> don't tell the program to overwrite it. You can also draw
> manually, if you will, via the program, by manipulating
> a "data" member and then let the program draw it.

Here is how it looks - 

;;; -*- lexical-binding: t -*-

(require 'bad-box)
(require 'bad-box-draw)
(require 'bad-draw)
(require 'bad-mode)
(require 'bad-move)
(require 'bad-rotate)
(require 'bad-size)
(require 'bad-triangle)
(require 'bad-write)

(defun bad-run-mini ()
  (let ((bg  (box :w 11 :h 9 :spc '(?\s)))
        (tri (triangle)))
    (draw bg)

    (size tri 7)
    (mov  tri 2 1)
    (rotate tri)
    (write-over bg tri)

    (let* ((i 35)
           (line (oref bg w)))
      (write-index bg i                ?G)
      (write-index bg (cl-incf i line) ?N)
      (write-index bg (cl-incf i line) ?U)

      (write-index bg (cl-incf i (* 2 line)) ?E)
      (write-index bg (cl-incf i)            ?m)
      (write-index bg (cl-incf i)            ?a)
      (write-index bg (cl-incf i)            ?c)
      (write-index bg (cl-incf i)            ?s))

    (draw-to-buf bg)
    (pop-to-buffer (bad-mode-buffer))
    (delete-other-windows)))

(provide 'bad-mini)

;; +---------+
;; | ####### |
;; |  ###### |
;; | G ##### |
;; | N  #### |
;; | U   ### |
;; |      ## |
;; | Emacs # |
;; +---------+


[-- Attachment #2: gnu-emacs.png --]
[-- Type: image/png, Size: 473 bytes --]

[-- Attachment #3: Type: text/plain, Size: 61 bytes --]


-- 
underground experts united
https://dataswamp.org/~incal

  reply	other threads:[~2024-09-29  7:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20 10:35 bad.el - ascii art games [package] [screenshots] [video] Emanuel Berg
2024-09-21  0:04 ` Emanuel Berg
2024-09-21 21:00   ` Emanuel Berg
2024-09-23  3:02 ` Richard Stallman
2024-09-25 16:07   ` Emanuel Berg
2024-09-25 23:44     ` Emanuel Berg
2024-09-26  5:50       ` Emanuel Berg
2024-09-29  2:14     ` Richard Stallman
2024-09-29  4:20       ` Emanuel Berg
2024-09-29  7:50         ` Emanuel Berg [this message]
2024-09-29 13:20         ` Emanuel Berg
2024-10-01 14:41         ` Richard Stallman
2024-10-01 17:08           ` Emanuel Berg
2024-10-11  0:25       ` pix.el (was: Re: bad.el - ascii art games [package] [screenshots] [video]) Emanuel Berg
2024-10-11  9:11         ` Emanuel Berg
2024-10-11  0:52 ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y13a3nm3.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).