Closed Thread Icon

Topic awaiting preservation: December 20lines Javascript Contest - Colors - Entries (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24274" title="Pages that link to Topic awaiting preservation: December 20lines Javascript Contest - Colors - Entries (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: December 20lines Javascript Contest - Colors - Entries <span class="small">(Page 1 of 1)</span>\

 
poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 12-02-2004 14:12

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)

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 12-09-2004 02:31

Sheesh, y'alls boring.

Here's my first entry. I have another idea on me, I'm just trying to figure out how to squeeze it into 20 lines without doing 0 * (var a = foo) + 0 * (var b = bar); or whatever, since I feel that's cheating.

(Yes, I know the depth ordering is backwards. It looks cooler that way. )

"Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clarke
"Any sufficiently arcane magic is indistinguishable from technology." -- P. David Lebling

(Edited by Iron Wallaby on 12-09-2004 02:32)

shingebis
Nervous Wreck (II) Inmate

From: UK
Insane since: Aug 2004

posted posted 12-10-2004 00:18

Here's mine, then. The bad news: It's Mozilla only, and it needs a stupidly fast computer to run. The good news: It is, I believe, a world first - Realtime GIF generation in Javascript.

GifPlasma

I was hoping this could be my secret weapon at next year's Assembly browser demo compo, but I haven't been able to get it working on IE, which kills that plan stone dead (for now). So, I'm sharing it with you all as a Christmas present. Who knows, maybe some genius here can figure out how to make IE behave, and then it can be my not-so-secret weapon at Assembly...

More details of the inner workings will come soon - I think this will need a thread of its own.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 12-24-2004 23:03

to view my entry, please promise me two things:

1. dont view it in a mozilla based browser, cause the javascript performance is slow as a dead snail. better performance is with IE or opera!
[edit: several people reported very good and smooth perfromance in mozilla too. hooray! ]

2. dont view it if you are an inmate because of epilepsy.

here we go:
http://www.embege.com/asylum/colors.html



(Edited by GRUMBLE on 12-27-2004 13:55)

« BackwardsOnwards »

Show Forum Drop Down Menu