Skip to content

Instantly share code, notes, and snippets.

View vydd's full-sized avatar
💭
parenthesizing

Danilo Vidovic vydd

💭
parenthesizing
  • Belgrade, Serbia
View GitHub Profile
(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)))
(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)
(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))))
@vydd
vydd / cypress
Created December 26, 2015 01:12
(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)
@vydd
vydd / build-ccl.lisp
Created December 21, 2015 16:13
^ ^ V V < > < > B A
;; (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)
(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))
(signal-zip A
(signal-map f B)
(signal-switch predicatep C D))
-->
(signal-graph (A (f B) (if predicatep C D))
#!/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)"
(ql:quickload :sketch)
(ql:quickload :alexandria)
(in-package :sketch)
(defparameter *maze-w* 60)
(defparameter *maze-h* 40)
(defparameter *tile-size* 10)
(defparameter *maze* nil)