Skip to content

Instantly share code, notes, and snippets.

else if(t==PT_FUSE)
{
if(parts[i].life<=0) {
t = PT_NONE;
kill_part(i);
create_part(-1, x, y, PT_SMKE);
goto killed;
}
for(nx=-2; nx<3; nx++)
else if(t==PT_FUSE)
{
if(parts[i].life<=0) {
t = PT_NONE;
kill_part(i);
create_part(-1, x, y, PT_SMKE);
goto killed;
}
for(nx=-2; nx<3; nx++)
(defmacro define-awesome-function (function args)
(if (null args)
`(defun ,function ()
,(multiple-value-bind (name) (read-from-string
(format "(slime-eval '(cl-awesome::%s))" function)) name))
`(defun ,function ,args
,(multiple-value-bind (name) (read-from-string
(format "(slime-eval `(cl-awesome::%s %s))" function
(let ((return-string ""))
(loop for i in args do
fib :: (Integral a) => a -> a
fib 0 = 0
fib 1 = 1
fib x = fib (x - 1) + fib (x - 2)
fibs :: (Integral a) => [a]
fibs = map fib [0..]
col :: (Integral a) => a -> a
col 1 = 0
fib :: (Integral a) => a -> a
fib 0 = 0
fib 1 = 1
fib x = fib (x - 1) + fib (x - 2)
fibs :: (Integral a) => a -> [a]
fibs 0 = [0]
fibs 1 = [1]
fibs x = fibs (x - 1) ++ [fib x]
(defun mandelbrot (file)
(let ((png (make-instance 'zpng:png
:color-type :grayscale-alpha
:width 200
:height 200))
(c (complex 0 0))
(z (complex 0 0))
(xres 800)
(yres 800)
(k 0)
(paredit-mode t)
(turn-on-eldoc-mode)
(eldoc-add-command
'paredit-backward-delete
'paredit-close-round)
(local-set-key (kbd "RET") 'electrify-return-if-match)
(eldoc-add-command 'electrify-return-if-match)
(show-paren-mode t)
(defun set-pixel (image x y channel)
(loop for i from 0 to (- (array-dimension image 2) 1)
do (setf (aref image x y i) (nth i channel))))
(defmacro define-awesome-function (function args)
(if (null args)
`(defun ,function ()
,(multiple-value-bind (name) (read-from-string
(format "(slime-eval '(cl-awesome::%s))" function)) name))
`(defun ,function ,args
,(multiple-value-bind (name) (read-from-string
(format "(slime-eval `(cl-awesome::%s %s))" function
(let ((return-string ""))
(loop for i in args do
use sdl
include SDL
SDLVersion_: cover from struct SDL_version {
major: extern UInt8
minor: extern UInt8
patch: extern UInt8
}
SDLAudioCVT: cover from struct SDL_AudioCVT {