Need a short nontrivial example program

I’m a member of the ACM at my university (Wichita State), and we are
allowed
to participate in the College of Engineering’s open house. We decided to
do
an arduino project b/c it seemed like the kind of thing that would be
accessible to engineers.

A while back, I read
http://talklikeaduck.denhaven2.com/2009/09/03/red-light-green-light and
loved the idea. So we decided to create a traffic light controlled by
the
Arduino, which receives commands from a test suite like RSpec, that
reflect
the status of the tests.

But how to show this off to the engineers?

Ruby is easy to learn, and with a good prebuilt test suite offering
helpful
explanations of why it failed, and what you might do to make it not
fail, I
think that I could sit a reasonably capable person down and have them
write
a program.

So I am looking for ideas about what this program should be. I want it
to be
nontrivial, because I want them to walk away thinking “holy crap, I just
did
something cool that I could see myself using at some point in the
future”.
And I want it to be short so that a number of people can give it a try.

For example, I really love the TweetStream example program (
http://github.com/intridea/tweetstream/blob/master/examples/growl_daemon.rb),
where you can have your Mac growl at you every time someone makes a
tweet
with a given keyword. But I think most engineers here don’t have macs so
will be harder to appreciate this. Plus, I’m not sure how to test some
of
that stuff, and to see it in action, you would kind of have to spam your
twitter account.

Anyway, looking for ideas.
-Josh

Josh C. wrote:

I’m a member of the ACM at my university (Wichita State), and we are
allowed
to participate in the College of Engineering’s open house.

[…]

So I am looking for ideas about what this program should be. I want it
to be
nontrivial, because I want them to walk away thinking “holy crap, I just
did
something cool that I could see myself using at some point in the
future”.
And I want it to be short so that a number of people can give it a try.

So the ruby-warrior thing doesn’t excite you? :wink:

It can be tough; what is really exciting for an engineer? They have a
very meticulous personality, point-by-point, attention to detail.

Maybe recreating Dwemthy’s array in front of their eyes?

On Fri, Apr 9, 2010 at 2:44 PM, Aldric G. [email protected]
wrote:

So the ruby-warrior thing doesn’t excite you? :wink:

I actually played with it back whenever Ryan announced it on his
Twitter.
But I had to read a lot of specs and source to figure out what was
available
to my robot, and how to have him do things. I put it down b/c I could
see it
was going to eat up a lot of time that I needed to devote to other
priorities.

It can be tough; what is really exciting for an engineer? They have a
very meticulous personality, point-by-point, attention to detail.

Maybe recreating Dwemthy’s array in front of their eyes?

Posted via http://www.ruby-forum.com/.

I’m really hoping for something that can be done in under 10 minutes
(the
format is not yet clear to me, I have a meeting with the people putting
it
on, but I may have to give a presentation, in which case, the whole
thing
should take under 10 min).

The TweetStream example is less than 15 lines of code. The final product
doesn’t need to be that short necessarily, but shorter is still better.

On 09.04.2010 21:26, Josh C. wrote:

So I am looking for ideas about what this program should be. I want it to be
nontrivial, because I want them to walk away thinking “holy crap, I just did
something cool that I could see myself using at some point in the future”.
And I want it to be short so that a number of people can give it a try.

What about a simply simulation of some system’s behavior that appeals to
engineers? Something from their domain. If you do a clean separation
between simulation framework and the specific simulation you might even
end up using it for something else.

Kind regards

robert

No! Not Dwemthy’s Array! You will most assuredly look like a fool when
your Rabbit gets trashed by the Industrial Raver Monkey as he’s
desperately trying to choke down leafy heads of lettuce!


Michael J.

@mjijackson

On Sat, Apr 10, 2010 at 7:47 AM, Josh C. [email protected]
wrote:

If I understand what you’re saying, you mean something like a truth table
maker?
-Josh

Hmm, I’ve been thinking about this, It could probably be done easily
with
tree top. But formatting output might require arcane knowledge.

On Sat, Apr 10, 2010 at 3:20 AM, Robert K.
[email protected]wrote:

What about a simply simulation of some system’s behavior that appeals to
http://blog.rubybestpractices.com/

If I understand what you’re saying, you mean something like a truth
table
maker?
-Josh

On 10.04.2010 14:48, Josh C. wrote:

did
something cool that I could see myself using at some point in the future".
And I want it to be short so that a number of people can give it a try.

What about a simply simulation of some system’s behavior that appeals to
engineers? Something from their domain. If you do a clean separation
between simulation framework and the specific simulation you might even end
up using it for something else.

If I understand what you’re saying, you mean something like a truth table
maker?

No. I thought more of a simulation of some mechanism (maybe mechanical
or whatever). You’d have a framework that would operate the simulation
and components that exhibit specific behavior. Say you could model a
basic with detectors for the fill level which open and close a valve
which controls water flow. You could create a simplified log of the
current fill level over time. Something like that.

Kind regards

robert