I don’t know about you guys, but one of my favorite movies of all time is WarGames with Matthew Broderick.
If you haven’t seen it, Netflix has it available on instant watch… go now… watch it… I’ll wait.
Alright, awesome movie huh?!
One of the characters in the movie is Joshua, also known as the WOPR or War Operations Plan Response.
The ServerSocket class allows code to act as a server for Transport Control Protocol (TCP) connections.
So I decided to combine my love of WarGames and the WOPR and create a WOPR emulator in Adobe AIR 2 that can be accessed using Telnet.
How to use the WOPR
Install using the badge installer here:[kml_flashembed publishmethod="dynamic" movie="http://zaalabs.com/demo/wopr/AIRInstallBadge.swf" width="215" height="180" targetclass="flashmovie" fvars="airversion=2.0&appname=WOPR&appurl=http://zaalabs.com/demo/wopr/WOPR.air&image=http://zaalabs.com/demo/wopr/woprbadge.jpeg"]
When you open the WOPR application it attempts to connect to 127.0.0.1 (localhost) on port 9999. If the console doesn’t show an error, you’re good to go.
On the Mac, open up Terminal (Applications > Utilities > Terminal)… if you’re on the PC, you should go and download PuTTY.
Once you’re in Terminal enter this command (if you change to a different port number, use that number instead of 9999):
telnet 127.0.0.1 9999
Once you’re in, you can have fun with Joshua. For example:
LOGON: Joshua GREETINGS PROFESSOR FALKEN. Hello HOW ARE YOU FEELING TODAY? I am fine. How are you? EXCELLENT. IT'S BEEN A LONG TIME. CAN YOU EXPLAIN THE REMOVAL OF YOUR USER ACCOUNT ON 6/23/73? People sometimes make mistakes YES THEY DO. SHALL WE PLAY A GAME? Love to. How about Global Thermonuclear War WOULDN'T YOU PREFER A GOOD GAME OF CHESS? Later. Let's play Global Thermonuclear War FINE
It’s a lot of fun! I haven’t implemented any of the games yet… but this shows what kind of cool stuff you can write with the new Adobe AIR 2 features.