Topic: 20 Liners - August 08 - Space Pages that link to <a href="https://ozoneasylum.com/backlink?for=30480" title="Pages that link to Topic: 20 Liners - August 08 - Space" rel="nofollow" >Topic: 20 Liners - August 08 - Space\

 
Author Thread
jseidelin
Nervous Wreck (II) Inmate

From: blog.nihilogic.dk
Insane since: Jul 2008

IP logged posted posted 08-08-2008 19:35 Edit Quote

Looks like I'm responsible for this month's theme and after a few days delay (due to excessive climbing of stairs in churches, arcs of triumph and Eiffel towers), here we go.

Space!

Use your 20 available lines of code to do something awesome relating to space.
Interactive solar systems, procedural exoplanets, space shooters or the good old starfield. It's all good for this month's 20 liner!


The rules:
Use a maximum of 20 lines of (effective) code
Literal object declarations count as one line ( a variable assignment ) except for the body of the methods declared there.
Commas shouldn't be used to execute several instructions on the same line.

As no one chose to use external libraries for July's, I figure we just let the option to use those stand? So, you are free to use any of the following JavaScript libs: Prototype/Scriptaculous, jQuery, Moo, Processing.js.

code:
// WARNING: nonsensical example approaching

            // declare a couple of variables
/* 01 */    var baz = "Fy",
/*  | */        foo =
/*  | */        {
/*  | */            name:"Bob",
/*  | */            kind:"cat",
/*  | */            yield:function( msg )
/*  . */            // the expressions of this function count
/*    */            {
/* 02 */                var msg = msg||"I'm "+ name +" the "+ kind +".";
/* 03 */                alert( "Meow! "+ msg );
/*    */            }
/*  . */            // resume to line 01
/*  | */            isAlive:Math.random()>.5;
/*  | */        },
/*  | */        bar = "it's candy";
            
/*    */    document.body.onclick = function()
/*    */    {
/* 04 */        val= prompt( 'enter a number' );
/* 04 */        for( i=0; i<10; i++ )
/*    */        {
/* 05 */            alert( stupidFunction( val, i ) );
/*    */        }
/*    */    }

            // like regular function, anonymous function declaration do not count
/*    */    (function()
/*    */    {
/* 06 */        setTimeout( arguments.callee, 10 );
/*    */    })
/* 07 */    (); // calling it, however counts as an expression
            
/*    */    function stupidFunction( a, b )
/*    */    {
/* 08 */        return a>b?a:b; // I said it was a stupid function
/*    */    }

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 08-09-2008 11:44 Edit Quote

Nice theme. I should have time to do a little something.

jseidelin
Nervous Wreck (II) Inmate

From: blog.nihilogic.dk
Insane since: Jul 2008

IP logged posted posted 08-19-2008 09:55 Edit Quote

*bump* Anyone else working on an entry? We can't have just have p01 running off with an easy victory.

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 08-19-2008 10:42 Edit Quote

Sweep the leg.

esskay
Bipolar (III) Inmate

From:
Insane since: Jan 2005

IP logged posted posted 08-20-2008 04:39 Edit Quote

I got sacked with work - sounds like a fun topic, looking forward to seeing the entries.

- SK

Arthurio
Paranoid (IV) Inmate

From: cell 3736
Insane since: Jul 2003

IP logged posted posted 08-21-2008 12:48 Edit Quote

Not sure if it qualifies by that logic a dog turd could be space-related
but... *drumroll* ... here's Fireworks in space

smoff
Nervous Wreck (II) Inmate

From: Finland
Insane since: Jul 2008

IP logged posted posted 08-21-2008 14:23 Edit Quote

I was working on a space shooter for last month's challenge during the train trip to Helsinki. If I've time I'll try to finalize it.. (though I started my studies at tut few days ago and I've lots of things in my todo list).

jseidelin
Nervous Wreck (II) Inmate

From: blog.nihilogic.dk
Insane since: Jul 2008

IP logged posted posted 08-24-2008 11:47 Edit Quote

Arthurio: Space is huge and largely unexplored. If you say that somewhere there are space fireworks like these, I'll take your word for it.

smoff: Sounds good, looking forward to it.

kwei
Nervous Wreck (II) Inmate

From: Germany
Insane since: Jul 2008

IP logged posted posted 08-30-2008 18:12 Edit Quote

My entry: Lunar Lander in 5 lines.
http://weibell.de/javascript/20lines/lunar-lander/

I believe, I've bent the rules a little bit too far this time...

_______________
http://weibell.de/

Arthurio
Paranoid (IV) Inmate

From: cell 3736
Insane since: Jul 2003

IP logged posted posted 08-31-2008 00:04 Edit Quote

It's definitely under 20 lines so who cares ... great job!

jseidelin
Nervous Wreck (II) Inmate

From: blog.nihilogic.dk
Insane since: Jul 2008

IP logged posted posted 09-01-2008 13:03 Edit Quote

p01, smoff: You guys got anything?

Jacob Seidelin - dabbler in the JavaScripty - http://blog.nihilogic.dk/

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 09-01-2008 13:55 Edit Quote

Nope sorry
I didn't have a specific idea and got myself carried away trying a new design for my site and fighting IE8b2 until the wee hours.

Side note: last week I bumped a bug about Opera not supporting xhr.overrideMimeType() correctly. Hopefuly the patch is on its way. Dunno if it will make it way down to 9.5x or 9.6



(Edited by poi on 09-01-2008 13:58)

jseidelin
Nervous Wreck (II) Inmate

From: blog.nihilogic.dk
Insane since: Jul 2008

IP logged posted posted 09-01-2008 21:16 Edit Quote

Alright then. Thanks for playing, all.

A fine 2nd place goes to Arthurio for his Fireworks in space

And 1st place, for the very cool and spacey Lunar Lander, goes to kwei.

Nice job to both of you. Kwei, you're up.


@p01: does that mean you can get an "untouched" responseText when that's fixed?


_____________

Jacob Seidelin - dabbler in the JavaScripty - http://blog.nihilogic.dk/

(Edited by jseidelin on 09-01-2008 21:17)

(Edited by jseidelin on 09-01-2008 21:18)

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

IP logged posted posted 09-01-2008 22:01 Edit Quote

Yes. It should provide an encoded ( will it be URL encoding, string escaping or whatever the server sends I'm not sure yet ) responseText, allowing XHR to load "binary streams" in Opera the same way as in FireFox and Safari. XHR.overMimeType() is of course some sort of hack meanwhile XHR2 and the responseBody get, widely, implemented. So when this patch lands, your ID3 and EXIF stuffs should finally work in Opera.

Kudos people. Kwei your lunar lander was a bit on the edge but well under 20 lines, and pretty cool. Arthurio, nice fireworks. At times they form some fractal-y patterns.



(Edited by poi on 09-01-2008 22:02)

kwei
Nervous Wreck (II) Inmate

From: Germany
Insane since: Jul 2008

IP logged posted posted 09-01-2008 22:26 Edit Quote

Hoorai
I promise that next time, I'll write more compact code and stay farther away from "the edge"! So, everyone ready for next round?

_______________
http://weibell.de/

esskay
Bipolar (III) Inmate

From:
Insane since: Jan 2005

IP logged posted posted 09-05-2008 03:47 Edit Quote

wow - I'm glad I didn't code anything as I was thinking of a lunar lander too having participated a bit in the Google Lunar X-Prize program. Nice work!

- SK

Suho1004
Maniac (V) Mad Librarian

From: Seoul, Korea
Insane since: Apr 2002

IP logged posted posted 09-05-2008 09:50 Edit Quote

Wow, that Lunar Lander game was pretty cool! Nice work!


___________________________
Suho: www.liminality.org | Cell 270 | Sig Rotator | the Fellowship of Sup



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu