I'm officially running a challenge through Digital Open for youth programmers.
Hopefully this is but the first of many Digital Open challenges.
Background:
I've started making my own text-based game in Python executed completely in the Python Shell (a part of IDLE that can be downloaded for free here). What I've discovered is how truly helpful it is to start building bare bones programs before diving into all of the Python modules like Pygame, OpenGL, etc. So, the game really isn't the point at all, but learning to code is.
The Idea:
Build a text based interactive program in Python that is executed only in the Python SHELL. Your game can be something like the old Advent game, or can take a completely different route, its completely up to you.
A Quick Note on Python:
I first got interested in programming when I was maybe 10 or 11, but I spent far too much time worrying about what language to go with. I contacted big-time programmers at large companies, and naturally each one told me to go with whatever language their company was working with. I kept dipping my toe into countless languages, and it took me far too long to learn this:
Python is the most powerful, easy to learn, cross-platform, fun programming language in the world.
Here's what it can do:
-It can create beautifully engineered games like EVE.
-It can work with all forms of math.
-It is by far the best way to network (servers, email parsing, etc.) that I know of.
-It can even work really well with wild things like encryption and codes (a while ago I build a simple encryption program that works with text-files).
-It can even be run off of hardware like microcontrollers, though because of the required interpreter it needs a relatively large one.
-And it can do just about anything else that could ever be done on a computer.
The only thing I know if that it can't do is build an operating system because of the interpreter, but that's fine because there are already lots of really great OSs out there, and to create your own would be unnecessary.
Also:
-Python is very popular, meaning it'll give you job opportunities in the future (NASA uses it, along with many others. In fact, MIT uses it a lot as well. Great thing for your college app, if you think of that kind of thing). This also means that there is a HUGE support group to help you out if you need at hand (there are awesome forums out there to help you like python-forum.org).
-Python is simple and elegant. Don't get me wrong, it's not insanely easy like Scratch (nothing against Scratch, I used to use it every day), but it is not a huge pain to learn like C and C++. The cool thing is that you can achieve in maybe 3 lines of Python code what would take perhaps 30 lines of C++ code just as easily, meaning you can spend more time building your program rather than typing away at endless lines of code like a C++ zombie.
-Python works pretty much everywhere. This is subject to change if you're using a very specific module, but 99.9% of the time your code can be run on Windows, Mac, Linux, and many others.
Start and stick with Python, its awesome.
The Rules:
-The game must be built in Python and executed on in the SHELL.
-You have to write the code all by yourself. No copy/pasting!
-You must be a Digital Open member (17 & under), sign up is free and safe.
Resources:
There are tons of books out there on Python, but if you don't feel like spending loads of money on 1,000 page books, then here are some great free resources I've used.
-Snake Wrangling for Kids is a free ebook in .pdf format on Python programming for kids.
-A Byte of Python is one of my favorites, and is also a free pdf.
-python.org has great overall info on the language.
-python-fourm.org is a great place to look for help.
End of challenge:
TBD.
Prize:
I personally cannot supply a prize, so if there is one then its up to Digital Open. :)
Submission:
Submit a project at Digital Open and tag it with: "Challenge: Text-based Python game".
Good luck!
Thursday, May 28, 2009
A challenge for youth programmers
Posted by Brennon at 4:45 PM 0 comments
Labels: computer science
Wednesday, May 27, 2009
Coming soon: Colony Command
I admit that its been a little while since my last post, and I acknowledge that many of you who took the BW Science Labs Survey requested articles more often, but well hey, school comes first.
I'm currently 260 lines of code through my next program, a gamed called Colony Command. CC is an old-style 100% text-based game built entirely in raw Python code. It is executed completely in the Python Shell, just like the very 1st computer games.

I'm building Colony Command to improve my raw Python coding skills, meaning I'm doing this to work on fundamentals rather than working with other libraries, modules, and toolkits like Tkinter.
Posted by Brennon at 7:52 PM 0 comments
Labels: computer science
Sunday, May 17, 2009
Working with LEDs
All engineers are different, some are clean-kept while others are unorganized and messy (I get bonus points there), some prefer picaxe microcontrollers over BASIC Stamps, and so on and so forth. However, we all have one thing in common: We all use LEDs, or Light Emitting Diodes. You see them everywhere: in your phone, your Xbox, computer, watch, and just about everywhere else.
Today I will show you a fun, simple, and cheap project that will teach you about working with LEDs.
A little while ago I went down to Radioshack and got a bag of 20 LEDs for $3.00. If this sounds amazing to you, wait. The 20 bag bundle is extremely poor quality, and only comes with green, red, orange, and yellow LEDs. I highly recommend you invest a couple extra dollars and get 5 higher quality LEDs rather than 20 cheap ones, or better yet, buy your LEDs online if you can. Remember to test them before you use them, I learned to do that the hard way.
Here are the parts for this fun and simple project:
-3 3volt LEDs of any color
-1 project box (optional but highly recommended)
-1 9v battery
-1 9v battery clip
-1 switch of any kind
-1 330 ohm resistor
-1 zip tie (optional)
-a soldering gun
-some solder
-and lots of hot glue!
Now that I look at at, this list looks long for a simple project, but its really a lot less daunting than it sounds, I promise.
These are the LEDs that came in the grab bag:
Unfortunately the bag did not say what voltage they used (typical Radioshack), and the guy there looked at me like I was asking him to name every neutrino in existence when I asked him about the voltage. I guessed about 2 or 3 volts, and went with 3 to be safe.
LEDs have what are called cathodes and anodes, or positive (+) and negative (-) sides. The anode is the long wire, while the cathode is the short one. I chose to color the negative red and the positive green so I would not confuse myself.
Drill three holes in the lid of the project container. I did this my my all-time favorite tool, the Dremel.
Sorry if the image is a bit difficult to view, I'm an engineer, not a photographer so you will have to bear with me as far as images go.
Glue in the LEDs and solder their anodes to their cathodes. This is really simpler than it sounds, hook together the greens with the reds and apply solder. Now solder your 330 ohm resistor to one of the two open leds (the little wires jutting out of the LEDs). Then solder the other end of the resistor to the correct battery side (guess and check to see which side works). Now wire the other open wire from the battery to one side of the switch (for easy access you should cut a hole in your box for the switch, depending on what kind you used), and finally the open LED's led to the switch. I used a zip tie to hold the wire to the battery to make it easier for me to close the box.
Attach the lid to the container with the parts resting inside and flip it on. If all is well, your three LEDs should illuminate the room (unless you used Radioshack LEDs, in which case you will illuminate much less).
Posted by Brennon at 6:04 PM 3 comments
Labels: engineering
Saturday, May 16, 2009
An All-New Brilliant Innovation Competition
I love nothing more than a competition where you can use your wits alone to triumph over everyone else. So, of course, I love Digital Open, a community where kids 17 and under can submit just about any project that they've been working on, be it a musical piece or robot. I've submitted one of my simple robots and BW Science Labs already, and I plan on posting many more.
Unfortunately, we live in a world today where most teens are sucked into TV and video games, losing the advantages they have when they are young and wasting precious time. Digital Open is a great effort to try and get kids off the couch and spend more time following their passion.
Perhaps my favorite thing about Digital Open is the community. Through DO I have been given great ideas on how to improve BW Science Labs, and a fellow Digital Open user, Joseph Dudley, created our current logo which is now in use.
I encourage everyone under 17 to submit at least a project or two at Digital Open, its definitely worth it.
And hey, you can win some cool prizes in the process, and earn "Achievements" like mine:
Posted by Brennon at 1:28 PM 0 comments
Labels: misc.
Sunday, May 3, 2009
Take the BW Science Labs Survey!
Last night I read Chris Guillebaeu's "279 Days to Overnight Success" on how he manages his blog. After reading it, I realized all of the great changes that BW Science Labs could go through. However, before I do this I want your input, so please go ahead and take the BW Science Labs Survey.
Posted by Brennon at 2:01 PM 1 comments
Labels: misc.
Sunday, April 26, 2009
Speedy the Robot
I just finished building another bristle bot named speedy.
Speedy is a fun and simple bristle bot that I built from parts that I had lying around the house. I make the chassis from scrap metal that I had, and I shaped it using my diamond cutter. This was perhaps the most dangerous part, as cutting through sheet metal in your room isn't usually a good idea, however if the proper safety measures are taken there's no risk.
I got the motor from my brother's Xbox controller, as he is yet to discover. Working with the motor was extremely frustrating because it has very short, thin wires that left no margin for error. It was also too powerful, as often times the enormous vibrations used to move the bristle bot would loosen the hot glue that held it down.
I soldered the motor and the power supply to a switch. I've seen and read enough MAKE tutorials to know how to solder properly, and fortunately I have a bit of experience with a soldering gun. The first contact point went smoothly, however the second point took me forever to get right, and the vibrations would keep loosening it until the point it would break off. I finally decided to solder it and then wrap the connection point in hot glue to prevent short-circuiting and disconnection.
I attached all of the parts using hot glue and double-sided foam tape, and added a flashing blue, yellow, and green light display at the front to give it a cooler look (especially when its on in the dark).
I actually spent more time troubleshooting then I did building, which is always frustrating.
This isn't my most applicable robot, but I suppose it could clean some floors before I take it apart or it drives its self off of a table one foot too high.



Posted by Brennon at 7:43 PM 4 comments
Labels: engineering, robots
Awesome Mac tweaks
Yesterday I was fortunate enough to speak with some high school programmers. They had messed around with the school terminal program on all of the library's macs to the point where our tech people blocked Terminal from use.
Most mac users fail to see what a powerful application Terminal really is. You can use it for networking, writing Perl code, and just about everything else. DOS (Windows) has a similar command-line, but the commands are different than that of Unix (mac).
Today, I found one of my favorite commands:
"defaults write com.apple.dashboard devmode YES"
I found it at Mac OS X tips, along with a couple others.
What this command allows you to do is take Dashboard widgets and put them on your desktop, which is pretty cool.
To get this command to work, you have to:
1) enter it in Terminal
2) enter "killall Dock"
3) press F12, click and hold on a widget, and press F12 again.
4) enjoy your favorite widgets on your desktop
When using Terminal, be sure to exercise caution, it is a very powerful application that you don't want to enter the wrong command in.
Posted by Brennon at 3:23 PM 0 comments
Labels: computer science, misc.