; bad.el - boxing after dark

bad.el boxing after dark

This is the home of bad.el, boxing after dark, which is an Emacs Lisp graphics program for GNU Emacs. It comes with a drawing program, the studio, plus ascii games and interactive demos.

bad-el.rss
↓ what's new 2025-01-24 ↓

the studio, drawing program

the bad.el studio drawing program for GNU Emacs

The bad.el studio is a drawing program for GNU Emacs.

control alpha, draw mock GUIs

a girl and a GUI, what looks like it

bad.el runs on top of Emacs but doesn't look like it.

image: SDXL

import ascii art, rotate

ascii furniture drawings and a logotype

Imported ascii drawings, building a shelf and a table. The shelf not accidentally so.

import images, show parts

rave participants and bubbles with text

This is the `defun' of my life.

image: SDXL

program: bad-studio

terminal studio

The studio running in a no-graphics terminal, the poor man's transparency works in mysterious ways.

bad.el in kitty

At the opposite end: running in kitty, that only runs in X.

ascii art, ansi colors

the bad.el editor with colorful abstract ascii art

Ascii art produced with the bad.el interactive editor that still has many features yet to be implemented.

demo 2: bad-draw-here

unconfigured Emacs with the same ascii art inserted thrice

A minimal demo of bad.el. Draw ascii art in and from Lisp, insert into a buffer.

demo 3: bad-egypt

ascii art: a pyramid in a box over a gradient background

This isn't just another demo.

ascii pyramid: __20h__
gradient: color.el by Drew Adams & Julien Danjou

ascii game 1: bad-toronto

ascii game showing the skyline of Toronto

An animated ascii game with a puzzle to be solved. The skyline of Toronto in a new version of an old work.

original ascii art: jgs

ascii game 2: bad-snake

the legendary binary cat, ascii snake game in Emacs
ascii snake game in Emacs level 2
for whom the bell ... ascii snake game in Emacs level 3

The familiar snake game, looking unfamiliar.

ascii art: josuah

demo 4: bad-grad

ascii pyramid in bright red

It is known that in ancient Egypt, they used 3D geometry and algebra.

demo 5: bad-maple

Frida Maple

Inspired by the 1985 game Déjà Vu.

image: Dalle

TODO

If you'd like to contribute to bad.el, there are many areas where it can be improved.

requirements

links

resources

Here are a bunch of resources from other Emacs projects as I stumble upon them or people tell me about them - new items are appended, so it isn't sorted other than that.

I'm happy to integrate awesome features and neat modules into bad.el. Neat means one is able to call a function, be it a `defun' or `cl-defmethod', and something interesting immediately happens - this is by far the best way. The second best way is: one is able to call a function, then useful and/or interesting data is returned for further inspection 😄

bad-2: speed kills

cl- and Elisp drawing the dark and light ansi color cubes

I'm currently working on a minimal [1] version of bad-el. This version already runs much faster thanks to more cognitive algorithms for drawing. But this isn't yet a release. I have other ideas before it skyrockets.

bad-4

bad.el with transparent ansi color boxes

bad.el now has transparency. If you don't believe me, take a look at the above screenshot. And I have been pretty open about it!

The screenshot shows 8 boxes that are transparent both on the foreground and background levels. They show the ansi colors - in the expected order, only I shifted it one step all around to make it start with white, instead of ending with it - for aesthetic reasons 😄

The quote in the box is from a manga about the immense Japanese manga/anime industry itself - a meta-manga if you will - a business which is mechanical and automated to an amazing degree BTW, on the tech - as expected - but also on the human level, what they do and how they work and how it is all organized and carried out in practice, and they describe it very well in the comic - as a programmer, and as a man, that impressed me a lot. Anyway, drawing is done, and in a boxed way, and the quote reads:

The world is all about money and intelligence.

Maybe!

The algorithm works like this. Simple, it polls the below color whenever it draws a transparent object on top of it. Then it makes a mix out of the old, below, and the new, above, color, this by adding the RGB components one by one, multiplying by a factor to specify what weight to assign each color. What is seen in the screenshot, there is only a slight advantage (56.25%) given to the upper color.

Advantages:
A simple and robust solution; gives an honest result for an easy-to-fathom definition of transparency, and it is a definition that makes sense for this application; it looks good, and it gives you the possibility to experiment with color blending.

Downside:
Performance. Especially if one moves a large transparent object around and over such a stack as seen in the screenshot, the FPS drops big. Everyone does their own computing and polling so it builds up.

Conclusion: [updated 2025-02-05] This project ... [RSN]

bad hand notes

[1] Minimal software isn't longer than
8 files * 256 lines/file =
2^3 files * 2^(2^3) lines/file =
2^(3 + 2^3) = 2^(3 + 8) = 2^11 = 2048 lines.

But this software doesn't qualify. Maybe I could make pass as not minimal but small software, where the same rules would apply only not for 2^3 but for 2^4, which would mean not more than 2^4 = 16 files with each no longer than 2^(2^4) = 65 536 lines.

all bad things ...

Thanks for reading this far! See you around 😄
send a mail
start over