This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun render-grid (grid cell-size) | |
(with-identity-matrix | |
(with-pen (make-pen :fill (gray 0.2) :stroke +white+) | |
(dolist (row grid) | |
(with-current-matrix | |
(dolist (cell row) | |
(rect 0 0 cell-size cell-size) | |
(with-font (make-font :color (hash-color (char-code (elt cell 0))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defparameter *theta* 0) | |
(defsketch recursive-tree (:width 640 :height 360) () | |
(background +black+) | |
(with-pen (make-pen :stroke +white+) | |
(let ((*theta* (* 90 (/ (in :mouse-x) width)))) | |
(with-identity-matrix | |
(translate (/ width 2) height) | |
(line 0 0 0 -120) | |
(translate 0 -120) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun set-window-fullscreen (win fullscreen-p &optional desktop-p) | |
(let ((fs (if fullscreen-p | |
(if desktop-p | |
sdl2-ffi:+SDL-WINDOW-FULLSCREEN-DESKTOP+ | |
sdl2-ffi:+SDL-WINDOW-FULLSCREEN+) | |
0))) | |
(check-rc (sdl-set-window-fullscreen win fs)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setf sb-impl::*default-external-format* :utf-8) | |
(asdf:oos 'asdf:load-op 'cypress) | |
(sb-ext:save-lisp-and-die "cypressmac" | |
:toplevel | |
(lambda () | |
(eval-when | |
(:compile-toplevel :load-toplevel :execute) | |
(sb-int:set-floating-point-modes :traps nil)) | |
(tmt:with-body-in-main-thread (:blocking t) | |
(setf xelf::*executable* t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; (push (merge-pathnames "lib/" *default-pathname-defaults*) | |
;; asdf:*central-registry*) | |
;; (push #P"/home/dto/blocky/" | |
;; asdf:*central-registry*) | |
;; (push #P"/home/dto/2x0ng/" | |
;; asdf:*central-registry*) | |
(ql:quickload '(:trivial-main-thread :cocoahelper :lispbuilder-sdl-mixer :lispbuilder-sdl-ttf :lispbuilder-sdl-image :uuid :cl-opengl :cl-fad)) | |
(defpackage :xelf-asd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ansi-boolean (x) | |
(list | |
(concatenate | |
'string "\\_<\\(" (symbol-name x) "\\)\\_>") 0 ''ansi-lisp-boolean)) | |
(defun ansi-constant (x) | |
(list | |
(concatenate | |
'string "\\_<\\(" (symbol-name x) "\\)\\_>") 0 ''ansi-lisp-constant)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(signal-zip A | |
(signal-map f B) | |
(signal-switch predicatep C D)) | |
--> | |
(signal-graph (A (f B) (if predicatep C D)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
sbcl \ | |
--eval "#+(and darwin sbcl)(eval-when (:compile-toplevel :load-toplevel :execute)(sb-int:set-floating-point-modes :traps nil))" \ | |
--eval "(ql:quickload :swank)" \ | |
--eval "(ql:quickload :trivial-main-thread)" \ | |
--eval "(ql:quickload :4x0ng)" \ | |
--eval "(tmt:call-in-main-thread #'4x0ng:4x0ng)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ql:quickload :sketch) | |
(ql:quickload :alexandria) | |
(in-package :sketch) | |
(defparameter *maze-w* 60) | |
(defparameter *maze-h* 40) | |
(defparameter *tile-size* 10) | |
(defparameter *maze* nil) |