javadvent calendar 2009!

kirkjerk's picture

So inspired by the Advent Calendars I had as a kid, the Lego ones they have now, and the Perl Advent site, I've made an advent Calendar -

http://kirkjerk.com/java/advent2009/

Every day there will be a little holiday-themed toy or game to play with (22 of the 25 are done so I'm not too worried)

Anyway, some of the little things came out really neat -- most were done in a trainwreck-like fashion, and there's a lot of similarities to what I put out for KotMK.

sergiocornaga's picture

This is neat. I will follow

This is neat. I will follow it eagerly.

qrleon's picture

Cool so far.

I like how you can open and close the applets independently and peek at the source.

kirkjerk's picture

Yeah! Running 20+ of these

Yeah!
Running 20+ of these can bog down you system so I didn't want to just leave everything open.

I've just found out about http://openprocessing.org , which is kind of like flikr for these things, and you can always view the source (also I like how every one of my little toys is totally defined by a single source code file...)

qrleon's picture

aaaaaaah!

AAAAAAAAAAAAAAAAH!

AttachmentSize
wreath_terror.png4.14 KB
kirkjerk's picture

i think Christmas is better

i think Christmas is better when it's a little scary

qrleon's picture

good show

the christmas eve one is great

kirkjerk's picture

yeah, I'm not very

yeah, I'm not very religious, but I'm also more open to some of the spirituality Christianity offers than I used to be.

SpindleyQ's picture

I just thought it was

I just thought it was hilarious to lead the wise men around and around in circles. "Follow me! Your lord and saviour is right here! WHOOP NOW HE'S OVER THERE OH WAIT NOPE TRICKED YOU HE'S OVER HERE AGAIN"

kirkjerk's picture

heeheeheehee both it and

heeheeheehee

both it and santa flyin' on the 25th are based on http://processing.org/learning/topics/follow3.html (also the core of my 'wreck Draggin' -- man, that is one of the loveliest bits of code I know. I use it but just barely understand its magic...

SpindleyQ's picture

Oh God, I just realized

Oh God, I just realized looking at that code (and then Wikipedia) that I've re-invented atan2 from first principles (using regular old atan) like 20 times over the years, each time as painful as the last, simply because I didn't know that atan2 existed.

I don't know whether to be angry at my past self or relieved that I'll never have to deal with that bullshit again.

It took me a little while to figure out how the code worked, and it's really the fault of the variable names. Once it clicked for me that the array of coordinates was for the BASE of the line segment, and the parameters to dragSegment passed in the coordinates for where the HEAD should be, the algorithm becomes quite straightforward. (Of course, the "head" and "tail" terminology doesn't make much sense in the context of your wisemen toy, since there isn't an actual line separating them.) It is quite a lovely effect, for how simple it is.

kirkjerk's picture

Straightforward but... a bit

Straightforward but... a bit emergent? I wouldn't have predicted such a neat, physical behavior from it, I mean.

Two other things that have amazed me w/ elegance lately:
http://openprocessing.org/visuals/?visualID=6417
(though can be made even more beautiful like I point out in the comments)

http://openprocessing.org/visuals/?visualID=3694 - weirdly organic given how "boxy" the algorithm turns out to be, but I stare at the end result I think I can see a hint of the boxiness, maybe.

kirkjerk's picture

all done!

So all 25 are finished and available!

I'm pretty pleased with how the while thing came out...

Strong's picture

Yeah, they were all really

Yeah, they were all really great! Except the sliding puzzle. That one can just go die.

kirkjerk's picture

aww. that's like, my

aww. that's like, my girlfriend's favorite.
I wonder if 3x3 is tougher than 4x4.

Strong's picture

Sliding puzzles in general

Sliding puzzles in general infuriate me. I'm not a fan of them.