Esolang Advent Calendar 2011 やってみる。

みむらです。

Esolang Advent Calendar 2011 ( http://atnd.org/events/22463 )

これの連携企画。

 

Esoteric Language : 難解言語 ってことなので、特に難解な物も有していない私なので、
適当に HSP でもやってみますね。

#define RADIUS 10
#define NUM 64

#module 
	#include "hspmath.as"
	c = 0
	#defcfunc Collision int x1,int y1,int x2,int y2
	return abs(sqrt(pow(x1-x2,2)+pow(y1-y2,2))) <= RADIUS@
#global

	dim p,NUM,4
	dim clr,NUM,3
	repeat NUM
		p.cnt.0 = rnd(640)
		p.cnt.1 = rnd(480)
		p.cnt.2 = 1 + (rnd(2) * -2)
		p.cnt.3 = 1 + (rnd(2) * -2)
	
		clr.cnt.0 = rnd(255)
		clr.cnt.1 = rnd(255)
		clr.cnt.2 = rnd(255)
	loop
	
	repeat
		redraw 0
		color 0,0,0
		boxf

		repeat NUM
			color clr.cnt.0,clr.cnt.1,clr.cnt.2
		
			circle p.cnt.0-RADIUS/2,p.cnt.1-RADIUS/2,p.cnt.0+RADIUS/2,p.cnt.1+RADIUS/2,1
	
			if p.cnt.0 >= 640 : p.cnt.2 = -1 : p.cnt.0 = 640
			if p.cnt.0 <= 0   : p.cnt.2 = 1  : p.cnt.0 = 0
			if p.cnt.1 >= 480 : p.cnt.3 = -1 : p.cnt.1 = 480
			if p.cnt.1 <= 0   : p.cnt.3 = 1  : p.cnt.1 = 0
	
			c = cnt
	
			repeat NUM
				if cnt = c : break
				if Collision(p.cnt.0,p.cnt.1,p.c.0,p.c.1) : p.c.2 *= -1 : p.c.3 *= -1 : p.cnt.2 *= -1 : p.cnt.3 *= -1
			loop
			if Collision(mousex,mousey,p.c.0,p.c.1) : p.c.2 *= -1 : p.c.3 *= -1
			repeat 2 : p.c.cnt += p.c.(cnt+2) : loop
		loop
		redraw 1
		await 0
	loop

というわけで、 Twitter やりながら適当に書いてみた。

難解ってことで、配列の書き方を昔の書き方で書いてみましたが、

どう見ても難解・・じゃないこれ・・w

image

 

もしかすると、

https://github.com/mimura1133/mm_hspsourceconverter

こっちの HSP ソースの方が遙かにごちゃごちゃしているのでは・・?w

 

んー・・。

であであー!!

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です