diff --git a/shinu.lisp b/shinu.lisp index 3071332..01f6eca 100755 --- a/shinu.lisp +++ b/shinu.lisp @@ -3,7 +3,7 @@ (setf *random-state* (make-random-state t)) -(defvar *file* "死ぬ.png") +(defvar *file* "shinu.png") (defvar *size* (+ 500 (random 2000))) (defmacro rand () `(random 1.0)) @@ -11,6 +11,12 @@ (defun rand-rgba (opacity) (list (rand) (rand) (rand) opacity)) +(defun randomized-linspace (begin end stp) + (let ((rnd (round (* 0.1 stp)))) + (map 'list + (lambda (x) (+ x (- (random (* 2 rnd)) rnd))) + (linspace begin end stp)))) + (defun main () (let* ((mid (* *size* .5)) (repeat (random 10)) @@ -20,7 +26,7 @@ (bg (rand-rgba 1.0)) (active (rand-rgba 0.6)) (sand (sandpaint* *size* :active active :bg bg))) - (loop for i in (linspace 100 (- *size* 100) repeat) + (loop for i in (randomized-linspace 100 (- *size* 100) repeat) for j from offset to (+ offset repeat) do (let ((snk (snek*)) (va (list 0 0)) @@ -45,4 +51,5 @@ (sandpaint-save sand *file*))) + (main) diff --git a/tweet.py b/tweet.py index fd7ab78..8bc7c49 100644 --- a/tweet.py +++ b/tweet.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- import twitter import config @@ -7,4 +6,4 @@ api = twitter.Api(consumer_key=config.consumer_key, access_token_key=config.access_token_key, access_token_secret=config.access_token_secret) -api.PostUpdate("", media=u"死ぬ.png") +api.PostUpdate("", media="shinu.png") diff --git a/update.sh b/update.sh index 772da39..2b406c2 100755 --- a/update.sh +++ b/update.sh @@ -1,2 +1,3 @@ -sbcl --script shinu.lisp -python tweet.py +/usr/local/bin/sbcl --script shinu.lisp +/usr/local/bin/python3 tweet.py +mv shinu.png out/`date +"%T"`.png