「波紋のアニメーション」on fx-CG50
fx-CG50 で "アニメーション" というと、Bad Apple を思う人も居るかと思います。かなり挑戦的な感じがしそうですが、そこは「見せ方」一つで、upython でも、そこそこのモノが出来上がりました。 以下のコードがそれです。 from math import * from casioplot import * from random import * width =384 height=192 div=30 n=5 class Hamon: def __init__(self): self.x=randint(0,width) self.y=randint(0,height) self.r=0 self.m=randint(0,height) def draw(self): circ(self.x,self.y,self.r,1,div) def erase(self): circ(self.x,self.y,self.r,0,div) def next(self): self.r+=1 if self.r>self.m: self.x=randint(0,width) self.y=randint(0,height) self.r=0 self.m=randint(0,height) def circ(x,y,r,col,s=0): c=(0,0,0) if col==0: c=(255,255,255) if r==0: set_pixel(x,y,c) return if s==0: s=pi*r/4 th=pi/4/s for i in range(int(s)+1): t=i/th m=int(r*cos(t)) n=int(r*sin(t)) set_pixel(x+m,y+n,c) set_pixel(x+m,y-n,c) set_pixel(x-m,y+n,c) set_pixel(x-m,y-n,c) set_pixel(x+n,y+m,c) set_p...