OZONE Asylum
Forums
DHTML/Javascript
20 Liners - January 08 - Dynamics
This page's ID:
29836
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
This month's theme is: [b]Dynamics[/b]. I know we've had similar competitions in the past, but we're all still getting our throwing arms back in and this allows for some variety. So this is dynamics in the loosest requirable sense. [quote] A code monkey said once: As usual, the main rule is to make your script in 20 lines of (effective) code. Comas shouldn't be used to execute several instructions on the same line See the code sample below to illustrate the basic rules : [code] <script type="text/javascript"> /* */ document.body.onclick = function() /* */ { /* 01 */ val = prompt( 'enter a number' ); /* 02 */ for( i=0; i<10; i++ ) /* */ { /* 03 */ alert( stupidFunction( val, i ) ) /* */ } /* */ } /* */ function stupidFunction( a, b ) /* */ { /* 04 */ return a>b?a:b; // I said it was a stupid function /* */ } </script> [/code] The document.body.onclick = function() does not count as a line as it's not some effective code and the function call could be put in the BODY tag ( or anyother HTML tag ). The declaration of the stupidFunction() does not count either for the same reasons. The coma in the line /* 03 */ is ok, since it simply separates the parameters of a function. [/quote] Please branch out as much as you wish from the topic! (within reason...) Examples of possible entries : [ulist] * A pool game * Particles in the wind * An aerofoil simulator * A radoll? ;) * Pinball * .... [/ulist] Best of luck to all! Can't wait to see what you might come up with :) [url=http://www.wrayal.org][img]http://www.wrayal.org/JS/asylum.JPG[/img][/url] [edit] Oh God...had an extra stupid moment. That should be, of course, "JANUARY 08" in the title, but it won't let me edit it. Also, that spurious "e]" shouldn't be there - I think this is a bug! [/edit] [small](Edited by [url=http://www.ozoneasylum.com/user/3481]wrayal[/url] on 01-03-2008 17:55)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »