randomized linspace a bit
This commit is contained in:
11
shinu.lisp
11
shinu.lisp
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
(setf *random-state* (make-random-state t))
|
(setf *random-state* (make-random-state t))
|
||||||
|
|
||||||
(defvar *file* "死ぬ.png")
|
(defvar *file* "shinu.png")
|
||||||
(defvar *size* (+ 500 (random 2000)))
|
(defvar *size* (+ 500 (random 2000)))
|
||||||
|
|
||||||
(defmacro rand () `(random 1.0))
|
(defmacro rand () `(random 1.0))
|
||||||
@@ -11,6 +11,12 @@
|
|||||||
(defun rand-rgba (opacity)
|
(defun rand-rgba (opacity)
|
||||||
(list (rand) (rand) (rand) 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 ()
|
(defun main ()
|
||||||
(let* ((mid (* *size* .5))
|
(let* ((mid (* *size* .5))
|
||||||
(repeat (random 10))
|
(repeat (random 10))
|
||||||
@@ -20,7 +26,7 @@
|
|||||||
(bg (rand-rgba 1.0))
|
(bg (rand-rgba 1.0))
|
||||||
(active (rand-rgba 0.6))
|
(active (rand-rgba 0.6))
|
||||||
(sand (sandpaint* *size* :active active :bg bg)))
|
(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
|
for j from offset to (+ offset repeat) do
|
||||||
(let ((snk (snek*))
|
(let ((snk (snek*))
|
||||||
(va (list 0 0))
|
(va (list 0 0))
|
||||||
@@ -45,4 +51,5 @@
|
|||||||
|
|
||||||
(sandpaint-save sand *file*)))
|
(sandpaint-save sand *file*)))
|
||||||
|
|
||||||
|
|
||||||
(main)
|
(main)
|
||||||
|
3
tweet.py
3
tweet.py
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
import twitter
|
import twitter
|
||||||
import config
|
import config
|
||||||
|
|
||||||
@@ -7,4 +6,4 @@ api = twitter.Api(consumer_key=config.consumer_key,
|
|||||||
access_token_key=config.access_token_key,
|
access_token_key=config.access_token_key,
|
||||||
access_token_secret=config.access_token_secret)
|
access_token_secret=config.access_token_secret)
|
||||||
|
|
||||||
api.PostUpdate("", media=u"死ぬ.png")
|
api.PostUpdate("", media="shinu.png")
|
||||||
|
Reference in New Issue
Block a user