This month's theme is: Colors.
The colors can be animated, static, ugly, pretty, interactive, ... I just want to see some colors on more time before a snow coat covers the Asylum.
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>
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.
Examples of possible entries :
- plasmas,
- color scheme generator,
- Dutch Color Scheme generator,
- Fireworks,
- Mondrians,
- ...
As usual, try to submit your entries here, and your comments in
December 20lines Javascript Contest - Colors - Comments
I hope you'll enjoy this topic.

(Edited by poi on 12-02-2004 14:12)