Coder’s Corner - Countdown

I love programming. I love how you can make something useful from scratch, and in very little time. I love it because it’s logical, and I’ve always been one for logic puzzles. And I especially love it because it’s fun.

As a computer science teacher I want everyone to love it. It’s an uphill battle. People tend to see programming as completely alien, difficult, and frustrating to understand. And especially as something that has very little use in their lives. Why worry about what goes on behind the scenes of a program? You’re just using the program, right?

My first thought was to spend paragraphs extolling the many virtues of programming to all of you. But why bother? I’m lucky if you’ve made it this far in the blog.

So I’ve decided to just give you stuff. Each time I make an entry in Coder’s Corner, I’m going to give you a program that I, or one of my students, have made. Hopefully, it will be something that you can actually use at home or in your class, like randomly putting all of your students into groups. I will also accompany each of these with the code that made the fun, little program. I’ll do my best to explain how it works, and maybe, just maybe, I’ll get an email from some you asking for the code so you can play around with it yourself.

If I’ve turned at least one of you into a programming lover by the end of this year, I’ve succeeded!

countdownCountdown Program
So here goes! The first program I’m going to show you (and give you - see below…) will be a Countdown program. Enter your starting value in the text box, then press the Start Countdown button. It will count from that number down to 0, and say Stop! I used this program during the faculty hockey pool draft to speed people up. Maybe you can see a use for it for your class (quizzes, speeches, review games). I will also give you the code so that you can modify it – change the colors, change the message at the end, whatever you want. You have the power!

If you’d rather just use the program and not bother looking at the code, you can find the program here (to download, right-click the link and choose Save Target As…). Simply download it to your documents and double-click to start the program!

And for those of you who want to see what’s behind this masterpiece, here goes! Don’t be too scared – all the green stuff is just my comments to help you understand the code better. While it might look scary at first glance, go through the lines while reading my explanations and you’ll find it’s not so bad.

Code-cntdown

Updates

Below are modifications of the program I gave above, based on feedback from peers.  Hopefully they have increased its potential for use.  Good luck with these, and please don’t hesitate to give me feedback!

Countdown 2.0 - this version allows you to enter minutes and seconds

Countdown 3.0 - with a Ding! - this version is the same as above but includes a ding sound when the countdown gets to zero.

Ding - this is the sound file for the ding.  You need to download it and save it in the same folder as the countdown 3.0 file.

11 Comments so far »

  1.  

    Darren said

    October 11 2007 @ 2:36 pm

    Cool! I’ll give it a try! Thanks!

  2.  

    DilworthM said

    October 11 2007 @ 2:41 pm

    Welcome to the blog Sash! Great first post, can we figure out a way to embed your tool on the blog so that people can actually try it out.

  3.  

    Ståle Brokvam said

    October 11 2007 @ 7:51 pm

    VB 6.0 cannot really be embedded in a web page - you can click on the link in the post above, though and it’ll load and run straight away. Sash, do the next one as a Java applet, for example, or a program in Scratch? Those ones can both be embedded in a web page.

  4.  

    Vida Vergel said

    October 15 2007 @ 1:42 pm

    Thank you! I can really use this in class!

    :-)
    v

  5.  

    Ji, Hua said

    October 15 2007 @ 3:16 pm

    It’s great this idea of sharing your programming expertise.

    Sasha, can I ORDER a small program to include in my InfoPath Forms to calculate the average of Students Stress Level? I can add all up to a total number, but don’t know how to calculate average, because when a number is zero, it’s not counted. It only counts those that’s NOT zero. Can you have a look at the link above and see if something simple can be made?

    Thanks a lot for this nice offering :)

  6.  

    Sasha said

    October 15 2007 @ 3:34 pm

    I was hoping I’d get some orders! I would be happy to. I just need to know if you can export the results from InfoPath to a text file. If so, it should be pretty easy to tabulate the results.

    Email me and we can schedule a time to meet.

    For the others out there, feel free to pick my brain. Cory Patterson has already commissioned a program that will randomly group his students into groups of 2, 3 or 4 (which I will be sharing with you all on a future post). If you have any other requests, don’t hesitate to call!

  7.  

    James Ebert said

    October 16 2007 @ 7:15 am

    Hey Sash,

    Nice one. One request for us down here with the little ones. Could it be changed to countdown from minutes as well? For example when we want to give the kids five minutes to do something it could show the minutes and seconds remaining. Then when it says stop maybe it could play a sound. I have made a timer that does this using powerpoint but it’s a pain having to change the starting slide for different amounts of time.

  8.  

    Sasha said

    October 16 2007 @ 7:21 am

    That’s a great idea! Then people can use it for quizzes, tests, exams, and other longer events (forensics and debate?). The buzz sound is a bit tricky. I’ll see what I can do. I should have a working copy by the end of the day. Stay tuned…

  9.  

    vojnova said

    October 16 2007 @ 11:06 am

    James, I’ve made the modifications you asked for. I think you’ll be happy with it. I think lots of teachers could find it useful too! I’ve put the link to the new version just below the code picture in the post. (to download, right-click the link and choose Save Target As…)

    Hope you all can get some use out of this! Good luck, and please let me know if there are any bugs.

  10.  

    vojnova said

    October 16 2007 @ 2:07 pm

    With a DING! Here’s version 3.0, with a little ding sound at the end.

    The more I think about it, the more similarities I see with writing. Constant refining until you get it right. I’m glad I could share this process with you as I developed this program. I hope the others will prove as interactive.

    The link for Countdown 3.0 is just below the code picture above.

  11.  

    vojnova said

    October 16 2007 @ 2:12 pm

    Woops! One more thing: you also have to save the DING file to your My Documents (the link for the file is just below Countdown 3.0). NOTE: You must place the ding.wav and the countdown 3.0 file in the same folder for it to work!

Comment RSS · TrackBack URI

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: