Andrew's Blog

To Infinity and Beyond

Canasta Database Tracking

27 March 2015


We meet up with some friends on a monthly basis for a game of Canasta. Personally I really enjoy this monthly gathering, and we have been doing it for quite a number of years.  We use a set of colored pebbles to randomly select who will partner with who, and since the first meeting have kept a book (we are now into our second book) to record the ongoing results.

A suggestion arose that I create a Canasta Database, and so I started out to create a Canasta Database which would not only track all our games, but show a running tally, graph and basic reports pertaining to the games played.

The attached Canasta Database is not filled with our scores, but I do remember looking around when I first went to design this to see if anyone had created anything similar, and no.

The Main Screen

Canasta Main Screen

Canasta Main Screen

That’s right, it has buttons…. Several in fact.  I have made no attempt (as usual) to hide my code or to prevent you from having full access to the database.

Modify Player Details

The first thing you will need with the Canasta Database to do is ‘Modify Player Details’.    Delete the pretend people from here, and put in the real names of people.  The tick box is simply used later on to hide or show peoples name on the main screen.  I define a location as we move around to different peoples places, so that just allows us to state who’s place we played the game at for that date.  I also take pictures of peoples places from time to time, and I just reference the path and name of the image I took.    There is a ‘secret’ double click action on the image, which allows you to ‘delete this game’, useful for when you make a big mistake and just want to start again, or to ‘true up’ the entire database.

Canasta - Player Details

Canasta – Player Details


View Canasta Games

The ‘View Canasta Games’ takes you to the main page, where you fill in the details.  At the start of each game, I select the Game date, type in information about the Game Number (memo field really) and the the time we start the game.  When we finish the game, I enter the end time and it manually calculates a rough time (hours.minutes).

I normally Enter Team 1: Player 1 being the person who deals first. Add their partner into P4.  Then P2, P5, P3 and finally P6.  The AI does the rest to figure out who the dealer is going to be what the round is and which team you are in.  It also automatically calculates the score and what your starting hand needs to be for that round (50, 90, 120).   The difficult part is probably that box to the right.  The Refresh button will refresh the entire page, including that box, and all you need to fill in is the associated score.  In the example we have completed two rounds.  (there is more to this page than just the screen dump below).

Canasta - Game Details

Canasta – Game Details

The Graph.  Everyone Loves Graphs
(so long as it isn’t a pie chart)

As the Canasta game is played, a graph is created to show everyone how well (or how bad) they are going. Frankly it’s the highlight for those sitting at the other end of the table!

Canasta - Graph

Canasta – Graph

Oh, so a Pie chart you say?  Here you go.  Pretty useless if you ask me. The only thing a pie chart is good for is, well, nothing. Unless you are into Pac-Man 🙂

Canasta - Pie Chart

Canasta – Pie Chart

Lies, Damn Lies and Stats

What is the point of a database if you can’t create some basic stats?   I also like to show how long it takes to present this page.. its a thing I do, recording how long it takes to perform action x – because then I know if action x takes too long, my code probably needs work!

Canasta - Show Stats

Canasta – Show Stats

Team Reports – More Stats

Finally, the part I like the most (and those of you out there with DB skills, feel free to improve this!).

For each Canasta Round, it shows you who is most likely to win that round based on their number of wins.  I also show the minimum number of rounds ever played (5 rounds) , the average rounds (8) and the maximum rounds we have played (14).  Then, remember how I said we ‘randomly’ team up by picking rocks?  Well, one would think it was indeed a random event, but the stats show it’s not as random as you would expect.  My friend Dorothy and I have teamed up 20 games, yet poor Penelope and I have only teamed up 5 times.  Go figure!

Finally, the number of Canasta wins, this also gives away number of times played and gives you an idea of whom you should team up with if you want to win.  Or perhaps it shows who cheats more than others ? 😉

Canasta - Team Reports

Canasta – Team Reports

It took HOW long to run?

Finally, for those of you interested in the Canasta stats, (the version you download at the moment is Version 1.32), below are some stats from earlier versions.  I just reset the counters on each version upgrade.  After all the version upgrades should have a faster AI and less errors.

Canasta - Run Times

Canasta – Run Times

Provisos, Quid Pro Quos, Disclaimers:

Yup, it’s that time of the day again. Sometimes I get a Code error when I try to close the Team Reports (on Me.gphCanastaRounds).  Perhaps in the future Ill bother with why and how to stop it.  It doesn’t annoy me as I just stop it and close out of the form using the X (top right hand corner).

1 Comment

  1. Michael Roberts

    March 29, 2015 at 1:58 PM

    You had to do a pie chart – for shame.

Leave a Reply

Your email address will not be published.


© 2017 Andrew's Blog

Theme by Anders NorenUp ↑