Figlet headings.

This commit is contained in:
sforman 2023-08-18 16:59:32 -07:00
parent ef9f7f2c0e
commit 20b517f083
1 changed files with 49 additions and 0 deletions

View File

@ -33,6 +33,15 @@
(chicken-script (load "defs.scm")) (chicken-script (load "defs.scm"))
(else)) (else))
;██╗███╗ ██╗████████╗███████╗██████╗ ██████╗ ██████╗ ███████╗████████╗███████╗██████╗
;██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝╚══██╔══╝██╔════╝██╔══██╗
;██║██╔██╗ ██║ ██║ █████╗ ██████╔╝██████╔╝██████╔╝█████╗ ██║ █████╗ ██████╔╝
;██║██║╚██╗██║ ██║ ██╔══╝ ██╔══██╗██╔═══╝ ██╔══██╗██╔══╝ ██║ ██╔══╝ ██╔══██╗
;██║██║ ╚████║ ██║ ███████╗██║ ██║██║ ██║ ██║███████╗ ██║ ███████╗██║ ██║
;╚═╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
;Interpreter
(define (joy stack expression dict) (define (joy stack expression dict)
(if (null? expression) (if (null? expression)
(values stack dict) (values stack dict)
@ -93,6 +102,14 @@
(values (cons (op (cadr stack) (car stack)) (cddr stack)) expression dict))) (values (cons (op (cadr stack) (car stack)) (cddr stack)) expression dict)))
; ██████╗ ██████╗ ███╗ ███╗██████╗ ██╗███╗ ██╗ █████╗ ████████╗ ██████╗ ██████╗ ███████╗
;██╔════╝██╔═══██╗████╗ ████║██╔══██╗██║████╗ ██║██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗██╔════╝
;██║ ██║ ██║██╔████╔██║██████╔╝██║██╔██╗ ██║███████║ ██║ ██║ ██║██████╔╝███████╗
;██║ ██║ ██║██║╚██╔╝██║██╔══██╗██║██║╚██╗██║██╔══██║ ██║ ██║ ██║██╔══██╗╚════██║
;╚██████╗╚██████╔╝██║ ╚═╝ ██║██████╔╝██║██║ ╚████║██║ ██║ ██║ ╚██████╔╝██║ ██║███████║
; ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
;Combinators
(define (joy-i stack expression dict) (define (joy-i stack expression dict)
(values (cdr stack) (append (car stack) expression) dict)) (values (cdr stack) (append (car stack) expression) dict))
@ -117,6 +134,14 @@
dict))) dict)))
;██████╗ █████╗ ██████╗ ███████╗███████╗██████╗
;██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔════╝██╔══██╗
;██████╔╝███████║██████╔╝███████╗█████╗ ██████╔╝
;██╔═══╝ ██╔══██║██╔══██╗╚════██║██╔══╝ ██╔══██╗
;██║ ██║ ██║██║ ██║███████║███████╗██║ ██║
;╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝
;Parser
(define (string-replace str from to) (define (string-replace str from to)
(string-intersperse (string-split str from #t) to)) (string-intersperse (string-split str from #t) to))
@ -162,6 +187,14 @@
(define (text->expression text) (parse (tokenize text))) (define (text->expression text) (parse (tokenize text)))
;██████╗ ██████╗ ██╗███╗ ██╗████████╗███████╗██████╗
;██╔══██╗██╔══██╗██║████╗ ██║╚══██╔══╝██╔════╝██╔══██╗
;██████╔╝██████╔╝██║██╔██╗ ██║ ██║ █████╗ ██████╔╝
;██╔═══╝ ██╔══██╗██║██║╚██╗██║ ██║ ██╔══╝ ██╔══██╗
;██║ ██║ ██║██║██║ ╚████║ ██║ ███████╗██║ ██║
;╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
;Printer
(define (joy-term->string term) (define (joy-term->string term)
(cond ((boolean? term) (if term "true" "false")) (cond ((boolean? term) (if term "true" "false"))
((number? term) (->string term)) ((number? term) (->string term))
@ -172,6 +205,14 @@
(string-intersperse (map joy-term->string expr) " ")) (string-intersperse (map joy-term->string expr) " "))
;██████╗ ███████╗███████╗██╗███╗ ██╗██╗████████╗██╗ ██████╗ ███╗ ██╗███████╗
;██╔══██╗██╔════╝██╔════╝██║████╗ ██║██║╚══██╔══╝██║██╔═══██╗████╗ ██║██╔════╝
;██║ ██║█████╗ █████╗ ██║██╔██╗ ██║██║ ██║ ██║██║ ██║██╔██╗ ██║███████╗
;██║ ██║██╔══╝ ██╔══╝ ██║██║╚██╗██║██║ ██║ ██║██║ ██║██║╚██╗██║╚════██║
;██████╔╝███████╗██║ ██║██║ ╚████║██║ ██║ ██║╚██████╔╝██║ ╚████║███████║
;╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
;Definitions
(define (initialize) (define (initialize)
(load-defs (make-hash-table string=? string-hash))) (load-defs (make-hash-table string=? string-hash)))
@ -184,6 +225,14 @@
(hash-table-set! dict (car def_list) (cdr def_list)))) (hash-table-set! dict (car def_list) (cdr def_list))))
;██████╗ ███████╗██████╗ ██╗
;██╔══██╗██╔════╝██╔══██╗██║
;██████╔╝█████╗ ██████╔╝██║
;██╔══██╗██╔══╝ ██╔═══╝ ██║
;██║ ██║███████╗██║ ███████╗
;╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝
;REPL
(define (prompt) (display "joy? ") (read-line)) (define (prompt) (display "joy? ") (read-line))
(define DICTIONARY (initialize)) (define DICTIONARY (initialize))