;;; POSSIBLY WORKING YET ; FOR ME AT LEAST
please report back
;;; Dependencies
ecl ; Non-portable ecl is used for the C-compiler-compiled executable file.
The non-portable elements should be feature'd out but I didn't do it yet.
The package itself is portable common lisp.
like
```
pkg_add ecl
```
or
```
emerge dev-lisp/ecls # why is it called this
```
or
```
apt install ecl
```
;;; Default location
```
mkdir -p ~/common-lisp/bit-d-generate
```
put the files from
gopher://tilde.institute/1/~screwtape/bit-d-generate/ into there. Using lynx
```
ecl <<EOG
(require :asdf)
(uiop:chdir #p"~/common-lisp/bit-d-generate")
(loop for string in '("bit-d-generate.lisp" "bit-d-generate.asd"
"packages.lisp" "README.txt"
"Makefile" "a.pbm")
do (uiop:run-program (format nil "lynx -dump --dont-wrap-pre ~
gopher://tilde.institute/9/~~screwtape/bit-d-generate/~a > ~0@*~a" string)))
EOG
#Ugh... Eat carriage returns with tr(1)
cd ~/common-lisp/bit-d-generate/ && tr -d "\r" <Makefile>tmp && mv tmp Makefile;
```
;;; just running make
```sh
make
```
results in the executably linked ./bit-d-generate
Try it out. a.pbm is a 64x64 pbm like 'a'
```
/bit-d-generate -i a.pbm
```
Using every option:
```
/bit-d-generate -i a.pbm -fgfg 1 -fgbg 2 -fgbg 3 -bgbg 6 -fgch O -bgch o
```
;;; Using in common lisp
I didn't feature-out the non-portable ecl build stuff so I guess we're in ECL.
Not that it matters.
```lisp
(require "bit-d-generate")
(in-package :bdg)
(with-open-file (*standard-output* #p"a.ascii"
:direction :output :if-does-not-exist :create
:if-exists :supersede)
(pbm2ascii #p"a.pbm" :foreground #\z :background #\s))
```
;;; the color controls are done by variables which you would need to set though.
Will document later
;;; This package is actually a utility for storing binary blobs for my hopfield nets
Not documented yet ;p
AI