Computer Science Teacher
Computer Science Teacher - Thoughts and Information from Alfred Thompson

March, 2011

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Heuristics–Programs that Learn


    How do we learn? How do we develop strategy in games, in work, in our daily lives? We store information and we use information from the past to decide what will happen in the future. In software we use heuristics to create software that learns. Recently I found a great example of a program that learns. It plays Rock Paper Scissors (also known as Rochambeau) and it can be found at the New Your Times interactive web site - Rock-Paper-Scissors: You vs. the Computer 


    I wrote about a simple program to allow two players to play Rock Paper Scissors against each other a while back but this program at the NY Times site pits a human against a computer. The user has a choice between playing a “novice” version that gradually learns how you play from actually playing against you and an “expert” version that uses the accumulated “wisdom” of playing over 200,000 games against human players. I elected to play the novice in the example above. I think it would have gotten better over time of course. I on the other hand was trying to figure out how “it” was thinking and I think that is why I was able to hold my own against it. Well for 21 rounds or so.

    This program allows the user/player to see what the computer is “thinking.” This makes the software a great learning tool. It lets you see how it uses and searches data, how it makes assumptions based on past performance and concludes what it should play. It assumes that people fall into patterns which is generally a safe assumption. I don’ t think it takes into account how the human is evaluating it though. In real life, in live games, humans take into account more then just patterns. Good Rock Paper Scissors players also look at body language. The look at how the opponent responds to what they play. It’s as much art as science. This makes me wonder how increases in technology, think Kinect, will allow computers to respond to how we say and do things (which is what people do) and not just what they say and do.

    This is not the only way to program a computer to play Rochambeau of course. One could have a computer just pick random plays. It would be interesting to see how that turns out given that computers, while not completely random, are generally more random than people are in things like this. That would make an interesting little project. In theory with absolute randomness each player would win the same number of times with a third of the games resulting in a tie. Rock, Paper, Scissors, Lizard, Spock would have a different outcome and I have no idea what that would be. I could see students looking at different strategies from random to heuristic with something in the middle that models how they play the game. It would be fun to have students write their own artificial intelligence modules and pit them against each other. Not sure this fits in a first course though. It would be interesting for post APCS exam students though. Anyone tried something like this?

  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Interesting Links 14 March 2011


    This highlight of my week last week was being in Dallas Texas for SIGCSE. This is by far my favorite conference of the year. I was able to connect with a bunch of people who read my blog (thanks for mentioning that everyone), talk to old friends, make new friends and even attend some really good sessions when I was able to sneak away from the exhibit hall. More about the things Microsoft was showing at the booth during the course of this week. In the mean time, The CSTA blog has Top 10 Reasons Why You Should Attend (or Should Have Attended) SIGCSE Next year SIGCSE will be in Raleigh North Carolina and it is not too late to start thinking about attending.

    Hélène Martin was at SIGCSE and I had a couple of brief chances to talk to her. She was getting a lot out of it and I really appreciate her review of the projects discussed in the “Nifty Projects” session which I unfortunately missed. Read her review at SIGCSE is Nifty 

    Two related things that Microsoft was showing at SIGCSE were and Pex 4 Fun. is an interactive web site to start learning the F# functional programming language. There are a series of tutorials that you can try out in any web browser. With all compiling done in the cloud you can use this site from just about any platform that supports the Silverlight plug-in. Once you are done there, visit Pex4Fun which supports code duels and challenges in F# as well as both C# and Visual Basic. And it’s fun.

    Microsoft has a new resource page for computer science teachers - – please visit and take a look at the available resources. We’ll be updating and adding to it on a regular basis so mark it in your favorites list.

    EdCamp Boston is coming in May

    edcamp Boston

    Sat, May 7 2011, 8:00a.m. - 5:00p.m.
    Microsoft NERD Center, Cambridge, MA, United States

    Dan Waters (@danwaters)  wrote How I Conceived A Simple WP7 App While Getting High – And Built It in 2 Hours which is about how he went from interesting idea (the getting high references to moving up in altitude BTW) to completed Windows Phone application in two hours.

    Lindsay Lindstrom (@LindsayInPhilly) who works for Microsoft in the Philadelphia area arraigned for some Imagine Cup teams to meet with CEO Steve Ballmer at the opening of the new Microsoft Technology Center in that city. You can read about it  at Steve Ballmer + Imagine Cup + Governor of PA = BEST DAY EVER!  In the mean time, Tara Walker is quoted heavily in an article from @blackamericaweb about some teams from Tuskegee University (@TuskegeeUniv) to compete in the Imagine Cup for the 1st time.

    Do you talk about ethical issues and computer crime with your students? Share this story with them and start a conversation Cops: Orlando Man Sabotaged "Whac-A-Mole" Games An example of why we need to teach ethics in computer science

    Lyn Langit (@llangit) has a provocative post titled Is YouTube Replacing Teachers? I’m not so enthused about this idea but the videos she links to are interesting.  Speaking of provocative, Scott Hanselman (@shanselman) asks Do you have to know English to be a Programmer? A good opportunity to talk about the internationalism of the computer industry and software development.

    Capitol Hill and Computer Science is an important post from @NCWIT on the need to lobby Congress and other elected officials to support computer science education.

    To end up with some educational geeky humor, xkcd has a cartoon about Server attention spans The true geek gets it – do your students get it?


  • Computer Science Teacher - Thoughts and Information from Alfred Thompson

    Python Tools for Visual Studio



    Microsoft has just released the Python Tools for Visual Studio add-in (Beta) .  This add-in lets programmers write Python code with Ironpython, CPython, debug & profile it, and also supports High Performance Computing (Windows HPC). IF you are already using Visual Studio and are interested in trying out Python in your classes this is well worth looking into.

    • Python is a cross platform language
    • Python is becoming extremely popular (#4 according to the funky Tobe index)
    • Python is being used as an intro to CS language all the way to writing PhD theses
    • The IronPython version ties nicely into .Net (along w the just released NumPy/SciPy libraries for .Net)
    • The HPC support - and soon Azure and Dryad - tie nicely into cloud computing
    • It’s free
    • It’s open source (apache 2.0)

    You can get it at

Page 5 of 10 (28 items) «34567»