What?
#tweetcoding: code something cool in <=140 characters of AS3
Who?
organized by @gskinner, open to anyone
When?
starting now, first round closes March 1
Why?
fame, fun, recognition of your peers, and some great prizes (see below)! I might also work a couple cool entries into one of my talks.
How?
paste the 140 characters of "gimme" code into Flash.
turn off strict mode (Publish settings > Flash > AS3 settings...
add your own 140 characters where it says /*src*/.
submit it via Twitter by sending two tweets: the first is the code you added, the second is a title for your entry, the #tweetcoding tag, and a link to the first tweet.
Gimme code.
g=graphics;
mt=g.moveTo;
lt=g.lineTo;
ls=g.lineStyle;
m=Math;
r=m.random;
s=m.sin;
i=0;
o={};
function f(e){/*src*/}
addEventListener("enterFrame",f);
Tip #1: use i as a frame counter to vary behaviour over time.
Tip #2: use o to store persistent data (ex. o.x=7
).
Tip #3: use m.PI & g.drawRect to save characters.
Rules.
you cannot modify the "gimme" code.
your entry must be submittable as a single 140 character tweet.
no additional assets.
AS3 strict mode should be off, targeting player 10.
anyone should be able to compile your entry with just your tweet, Flash CS4, and these instructions.
Prizes.
Winner receives a copy of Flash CS4 courtesy of Adobe.
The winner and two runners-up will receive "AdvancED ActionScript 3.0 Animation" by Keith Peters, courtesy of Friends of Ed.
Sample.
here's a very simple sample in 110 characters. Simply paste this code at /*src*/, test movie, and it will draw a colorful spiral.
if(i>400)return;
if(i++<1){x=275;y=200}
ls(3,r()*1e7,1);
mt(s(i/9)*i,m.cos(i/9)*i);
lt(s(i/9)*200,m.cos(i/9)*200);
Credit.
much love to Adobe for providing the awesome grand prize (a copy of Flash CS4)!
a big thank you to Friends of ED for providing 3 copies of Keith Peter's "AdvancED ActionScript 3.0 Animation" as prizes!
thanks to @kevinSuttle for sparking the idea.
thanks to my lovely wife for putting up with me spending time on this, when I should be doing other things.
Links.
link - track #tweetcoding, and view compiled entries online
link - simple utility to compress and check the length of your code