Behold! Yet another game from our childhood, when nothing more than paper and pencil was all we had to keep us entertained, Dots and Boxes was one of those intangibly exciting and addictive games we used to play against our bretheren. Simple, fun and cheery, it was quick to set up and strategy was key to beating your foe. And now, for your entertainment, it's available to play in LabVIEW!
Intro
As a personal project I spent some time creating this game in LabVIEW because, well, I wanted to. And that's good enough reason for me.
If you don't know Dots & Boxes then the rules are simple. The winner is the player with the most boxes at the end of the game, and you create boxes by drawing lines between the dots. The challenge is creating boxes without letting your opponent steal them!
Each player takes a turn to draw a line between two dots (only horizontal and vertical lines permitted). If that line completes the four sides of a box then you win the box and get to draw another line. Use strategy to force the hand of your opponent and crush them into defeat!
I want to play it, how please?
Computer Opponent
If you're playing against the computer, it will choose it's edge immediately so it will be your go again quicker than you can blink. Keep drawing edges, and attempt to complete boxes. Warning! The computer player will spot any 3-edged zones that can be easily completed to make a box, so if you leave an obvious opening like that it will take your box from you and leave you weeping in the cold! So try to be strategic!
The computer opponent is not so smart actually, and can easily be fooled. Sometimes it will create 3-edged areas itself, handing you a free box opportunity on a plate. And it can't project forwards to estimate the value of any particular move, so with your human brain you should be at an advantage. However, it's beaten me more than once, and I'm not ashamed to admit it.
Game Features
It's very simple, but these features are worth checking out:
Creating your own Computer Intelligence
I'm hoping y'all out there will be interested in creating your own computer opponent! The "Computer_Play" state of the state machine calls the computer player code to choose which edge to create, and included here is my own very basic computer player. Please go ahead and create your own computer player code and try it out! If you can post it here then all the better! I'd certainly be interested to see what people come up with!
There will be a challenge over on the Breakpoint forum for user entries, and if we get enough we might be pitching them against one another. Fun times!
LabVIEW Specifics
It's written in LabVIEW 2011 under Windows 7. It should work on all platforms, although I haven't tested it on anything else.
Comments
There's room for improvement, furtherment, or I might just do nothing more with it. It was fun to create, and I'd love to see some intelligent computer opponents developed by you smart folk out there that will make this game a real challenge to play!
All comments welcome!
Parting Words
Enjoy! And don't let your boss catch you playing games at work. It may be LabVIEW, but it's still a game
Version History
V1.0 - First release (7th April 2014)