Jump to content
Washington Football Team Logo
Extremeskins

Dots and Boxes Game


Thinking Skins

Recommended Posts

When I was in high school, I learned about a game called Dots and Boxes. We decide on a grid size (say 10 rows by 10 columns) and draw a grid of "dots" with the specified number of rows and columns. Then we alternate moves by connecting two neighboring dots that are on the same horizontal or vertical line until there are no more neighboring dots to connect. We call a box an area that is in between two neighboring dots on one row and the two neighboring dots in the same columns on the row below it. If a player draws the last line on a box, then they are said to own that box. At the termination of the game, the player who owns the most boxes is called the winner.

 

 

dots.jpg

I'm certain I'm not the only one who remembers this game from high school, if not before. I just programmed it on my web page though. Check it out and let me know what you think.

Link to comment
Share on other sites

I vaguely remember this game from my childhood, although it was more of a summer family roadtrip thing for me.

 

BTW, did you write all of the posts on that site?  I noticed the posts on Hidden Markov Models and the Viterbi algorthim / Baum-Welch algorithm.  Once upon a time, I wrote my master's thesis by comparing the B-W algorithm to simple clustering algorithms to train HMMs used for speech recognition.  It's nice to nerd out on E-S.

Link to comment
Share on other sites

Yes, I remember this game.  What rules are you using?  I recall that the way we played, if you closed a box to claim it then you got to go again, which could potentially lead to getting a string of boxes in a row before the other player got to go again.

 

EDIT:  That reminds me, did you ever do graph paper racing?  Essentially you draw a course on the graph paper, similar to a race track.  Then each player moves from a dot on the starting line.  At each turn you can accelerate or decelerate by one.  So starting you could move one square, next turn two, next turn three (or decelerate back to one), etc.  The trick is the turns.  The same rules apply for turns.  On each turn you can move left or right by one, then on your successive turn two, etc.  If you hit a wall you lose.  Finding the most efficient way to the finish and getting there first wins.

Link to comment
Share on other sites

I vaguely remember this game from my childhood, although it was more of a summer family roadtrip thing for me.

Yeah, this was a game from my childhood that I recently studied while in grad school and found that it has some nice mathematical properties. And, although the math can be done, from what I understand the math behind the game is more complicated because at the end you have to count instead of a game like NIM where the last player to move wins or loses.

BTW, did you write all of the posts on that site?  I noticed the posts on Hidden Markov Models and the Viterbi algorthim / Baum-Welch algorithm.  Once upon a time, I wrote my master's thesis by comparing the B-W algorithm to simple clustering algorithms to train HMMs used for speech recognition.  It's nice to nerd out on E-S.

Yeah, http://learninglover.com is my playpen of sorts. I like to use it to provide different references/tutorials/help for friends and children of friends, but its also a useful way to expand my current knowledge of mathematics. For example, you mention HMMs and I have very little experience with them so I was able to code up the algorithms. I'm still looking for more applications of them though so that I can get a better understanding.

Link to comment
Share on other sites

I like how it tells me when I lose but is strangely silent when I win. :P

 

Fun, and it uses the rules I'm used to.  Only thing is maybe do something to make it more obvious where the computer placed their line on that turn.  With the larger grids it gets really tough to tell where the CPU made their last move as the game goes on.

Link to comment
Share on other sites

I remembering playing a game similar to this. I think it was called S.O.S.

I know the game SOS, but dots and boxes is a bit different. SOS is more like an advanced Tic Tac Toe, generalized to an m by n board (instead of 3 by 3). But now that you mention it, it'd be nice to code it up to learn what the optimal strategy behind the game is.

I like how it tells me when I lose but is strangely silent when I win. :P

 

Fun, and it uses the rules I'm used to.  Only thing is maybe do something to make it more obvious where the computer placed their line on that turn.  With the larger grids it gets really tough to tell where the CPU made their last move as the game goes on.

Haha. yeah I need to fix that. I made a minor modification to it yesterday that wound up changing the display of winners and losers (basically it only displays the loser if the cpu makes the last move). I'll have that fixed tonight.

Yes, I remember this game.  What rules are you using?  I recall that the way we played, if you closed a box to claim it then you got to go again, which could potentially lead to getting a string of boxes in a row before the other player got to go again.

Yeah, I should probably state that. Its so hard to write out the rules of a game I've been playing for so long but have never really seen the rules myself. I guess I just expected people to remember.

EDIT:  That reminds me, did you ever do graph paper racing?  Essentially you draw a course on the graph paper, similar to a race track.  Then each player moves from a dot on the starting line.  At each turn you can accelerate or decelerate by one.  So starting you could move one square, next turn two, next turn three (or decelerate back to one), etc.  The trick is the turns.  The same rules apply for turns.  On each turn you can move left or right by one, then on your successive turn two, etc.  If you hit a wall you lose.  Finding the most efficient way to the finish and getting there first wins.

hmmm, interesting. I've never heard of this game. But I'm definitely interested in it. Is there a single dot that both players move or does each player have his/her own dot? I'm going to see if I can find some more stuff on this cause this may be a nice game to program up too.

I didn't expect to come here and get more ideas, but I like it.

Link to comment
Share on other sites

I dominated at that game.

Something to improve your A.I. and make it harder: When the computer is on a run, if when it finishes it's run it has to open one up to you, have it conclude it's run prematurely and skip a box. Doing so will give two boxes to the other player that normally would have been picked up in the run, but then they'll be forced to give the computer another run.

I used that little trick to dominate people back in school. Once the runs started, the game was mine to dictate.

Link to comment
Share on other sites

hmmm, interesting. I've never heard of this game. But I'm definitely interested in it. Is there a single dot that both players move or does each player have his/her own dot? I'm going to see if I can find some more stuff on this cause this may be a nice game to program up too.

I didn't expect to come here and get more ideas, but I like it.

 

Each player has his own dot to move.

Link to comment
Share on other sites

I dominated at that game.

Something to improve your A.I. and make it harder: When the computer is on a run, if when it finishes it's run it has to open one up to you, have it conclude it's run prematurely and skip a box. Doing so will give two boxes to the other player that normally would have been picked up in the run, but then they'll be forced to give the computer another run.

I used that little trick to dominate people back in school. Once the runs started, the game was mine to dictate.

Yeah, that's something I was thinking to do to make an expert level of the game. Really, this was a 4 hour crunch coding session that was more of a can I do it type thing. The look ahead, or only finishing part of a series of boxes really helps but it can make the computer unbeatable and that'll make the game less fun. But its something to add.

Link to comment
Share on other sites

Yes, I remember this game.  What rules are you using?  I recall that the way we played, if you closed a box to claim it then you got to go again, which could potentially lead to getting a string of boxes in a row before the other player got to go again.

 

EDIT:  That reminds me, did you ever do graph paper racing?  Essentially you draw a course on the graph paper, similar to a race track.  Then each player moves from a dot on the starting line.  At each turn you can accelerate or decelerate by one.  So starting you could move one square, next turn two, next turn three (or decelerate back to one), etc.  The trick is the turns.  The same rules apply for turns.  On each turn you can move left or right by one, then on your successive turn two, etc.  If you hit a wall you lose.  Finding the most efficient way to the finish and getting there first wins.

This is very much like the board game Formula De.

Link to comment
Share on other sites

Yeah, that's something I was thinking to do to make an expert level of the game. Really, this was a 4 hour crunch coding session that was more of a can I do it type thing. The look ahead, or only finishing part of a series of boxes really helps but it can make the computer unbeatable and that'll make the game less fun. But its something to add.

Less fun for the player, more fun for you laughing at their torment. :)
Link to comment
Share on other sites

Fun, and it uses the rules I'm used to.  Only thing is maybe do something to make it more obvious where the computer placed their line on that turn.  With the larger grids it gets really tough to tell where the CPU made their last move as the game goes on.

 

I missed this when you first stated it, but thats a good idea. I may just make the CPUs moves like red or something, or just red when they first make then move then black afterwards.

Link to comment
Share on other sites

And so it has been done.

I like it.  Little buggy; if you start off your game with a horizontal line the CPU will start making phantom lines throughout the game.  But that aside, the red on it's most recent move really makes it easier to keep track of whats going on on the larger grids. *thumbsup*

Link to comment
Share on other sites

I like it.  Little buggy; if you start off your game with a horizontal line the CPU will start making phantom lines throughout the game.  But that aside, the red on it's most recent move really makes it easier to keep track of whats going on on the larger grids. *thumbsup*

 

Yeah, I noticed taht this morning. I'll have to fix it tonight after work.

Link to comment
Share on other sites

I like it.  Little buggy; if you start off your game with a horizontal line the CPU will start making phantom lines throughout the game.  But that aside, the red on it's most recent move really makes it easier to keep track of whats going on on the larger grids. *thumbsup*

OK, I fixed it. I'll play around with it a little later, hopefully the bugs are gone though.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...