What is the coolest thing you can do in <10 lines of simple code?  Help me inspire beginners!
So this is a totally subjective, likely-to-get-closed post.  I'm not making this Community Wiki because I want *you* to earn rep on your awesome answers.  But hear me out before you vote to close.

I'm looking for the coolest thing you can do in a few lines of simple code.  I'm sure you can write a [mandelbrot set in haskell in like 15 lines](http://mcfunley.com/cs/blogs/dan/archive/2007/12/25/1532.aspx) but it's difficult to follow.  And **my goal is to inspire students that programming is cool**.  We *know* that programming is cool because you can create anything you imagine - it's like the ultimate creative outlet.  I want to inspire these beginners and get them over as many early-learning humps as I can.

Now my reasons are selfish.  I'm teaching an Intro to Computing course to a group of about 60 half-engineering majors, half business majors, pre-college-freshmen.  They are specifically the students who came from underprivileged High Schools.  I've done it before and generally there are a few rockstars, the few who try very hard and kind of get it, the few who try very hard and barely get it, and the few who generally don't care.  I want to reach as many as I can, and get as many people pysched about it as I can.



So to get the ball rolling and give an example, here's a 1-line VBS script to get your computer to talk to you

    CreateObject("sapi.spvoice").Speak InputBox("Enter your text","Talk it")

I could use this to demonstrate order of operations.  I'd show the code, let them play with it, then explain: There's a lot going on in that line, but it the computer can make sense of it, because it knows the rules.  Then I'd show

    4(5*5) / 10 + 9(.25 + .75)

And you can see that first I need to do is (5*5).  Then I can multiply for 4.  And now I've created the Object.  Dividing by 10 is the same as calling Speak - I can't Speak before I have an object, and I can't divide before I have 100.  Then on the other side I first create an InputBox with some instructions for how to display it.  When I hit enter on the input box it evaluates or "returns" whatever I entered.  (Hint: 'oooooo' makes a funny sound)  So when I say Speak, the right side is what to Speak.  And I get that from the InputBox.

So when you do several things on a line, like:

    x = 14 + y;

You need to be aware of the order of things.  First we add 14 and y.  Then we put the result (what it evaluates to, or returns) into x.

So that's my goal, to have a bunch of these cool examples to demonstrate and teach the class while they have fun.  I tried this example on my roommate and while I may not use this as the first lesson, she liked it and learned something.

Some cool [mathematica programs that make beautiful graphs or shapes](http://reference.wolfram.com/legacy/v5/Tour/WritingProgramsInMathematica.html) that are easy to understand would be good ideas and I'm going to look into those.  Here are some [complicated actionscript examples](http://www.25lines.com/) but that's a bit too advanced and I can't teach flash.  What other ideas do you have?
What is the coolest thing you can do in <10 lines of simple code?  Help me inspire beginners!
===

So this is a totally subjective, likely-to-get-closed post.  I'm not making this Community Wiki because I want *you* to earn rep on your awesome answers.  But hear me out before you vote to close.

I'm looking for the coolest thing you can do in a few lines of simple code.  I'm sure you can write a [mandelbrot set in haskell in like 15 lines](http://mcfunley.com/cs/blogs/dan/archive/2007/12/25/1532.aspx) but it's difficult to follow.  And **my goal is to inspire students that programming is cool**.  We *know* that programming is cool because you can create anything you imagine - it's like the ultimate creative outlet.  I want to inspire these beginners and get them over as many early-learning humps as I can.

Now my reasons are selfish.  I'm teaching an Intro to Computing course to a group of about 60 half-engineering majors, half business majors, pre-college-freshmen.  They are specifically the students who came from underprivileged High Schools.  I've done it before and generally there are a few rockstars, the few who try very hard and kind of get it, the few who try very hard and barely get it, and the few who generally don't care.  I want to reach as many as I can, and get as many people pysched about it as I can.



So to get the ball rolling and give an example, here's a 1-line VBS script to get your computer to talk to you

    CreateObject("sapi.spvoice").Speak InputBox("Enter your text","Talk it")

I could use this to demonstrate order of operations.  I'd show the code, let them play with it, then explain: There's a lot going on in that line, but it the computer can make sense of it, because it knows the rules.  Then I'd show

    4(5*5) / 10 + 9(.25 + .75)

And you can see that first I need to do is (5*5).  Then I can multiply for 4.  And now I've created the Object.  Dividing by 10 is the same as calling Speak - I can't Speak before I have an object, and I can't divide before I have 100.  Then on the other side I first create an InputBox with some instructions for how to display it.  When I hit enter on the input box it evaluates or "returns" whatever I entered.  (Hint: 'oooooo' makes a funny sound)  So when I say Speak, the right side is what to Speak.  And I get that from the InputBox.

So when you do several things on a line, like:

    x = 14 + y;

You need to be aware of the order of things.  First we add 14 and y.  Then we put the result (what it evaluates to, or returns) into x.

So that's my goal, to have a bunch of these cool examples to demonstrate and teach the class while they have fun.  I tried this example on my roommate and while I may not use this as the first lesson, she liked it and learned something.

Some cool [mathematica programs that make beautiful graphs or shapes](http://reference.wolfram.com/legacy/v5/Tour/WritingProgramsInMathematica.html) that are easy to understand would be good ideas and I'm going to look into those.  Here are some [complicated actionscript examples](http://www.25lines.com/) but that's a bit too advanced and I can't teach flash.  What other ideas do you have?