May 29 2007

A Game of Cards?

Several years ago, I made a computer card game called SevenUp. It’s a game my family played when I was a child, and I have always loved the game. As it turns out, SevenUp is not the real name of the game, that’s just what we called it. The real name is just Sevens, or Fan Tan.

In any case, I wanted to make the game for the computer, and as I was programming in Delphi at the time, Delphi being the best programming tool in it’s day, I wrote it in Delphi. There is a link to the game on the right side of this page, and at the top of this post, for you to download. I would love to upgrade the game, but I am afraid that I have long since lost the source code for it. Any updates to the game will require a complete rewrite. And that is my intention.

When I was writing this program, I searched the web for some pre-packaged card deck component that I could use. I found one that I really liked. It was a component called TPlayingCard by Simon Fitch, and I gave him credit in the documentation for the game.

As time moved on, Microsoft came out with Visual Studio .Net, and it included the C# language. It pained me to admit it, but I liked it better than Delphi. And of course, the first project I set out to make was my favorite card game, Sevens. My strategy for presenting the cards changed a little, however, and instead of compiling a card deck into the program, I chose to write a wrapper for the Cards.dll that shipped with Windows.

The wrapper worked wonderfully, and I even improved on the algorithm I used for playing the game. I never finished the game, however, because school became a priority for me. Then, after I graduated, I became lazy (as indicated in my previous post).

During this lazy period, Microsoft came out with their latest OS, Vista. Vista was different from Windows XP in a number of ways, but the one difference that was relevant to my card game was that it doesn’t ship with Cards.dll. Instead, it has a CardGames.dll, which is used by the card games that ship with Vista.

So, my dilemma is, do I stick with old technology and port the Cards.dll with my game? Do I find another card component that works with .Net? Or do I try to find a way to make use of the CardGames.dll that ships with Vista?

I would love to learn to make use of the latest resources, but alas, I have search the web for any information on CardGames.dll, and have found nothing. So I tried peaking into the dll myself, and what I found is not promising. It seems that the CardGames.dll file was made specifically for the the games that ship with Vista. I don’t think that the dll is a general purpose library, like the Cards.dll was. It is still possible that it may contain some general purpose functions, but at this time I don’t feel it is worth the effort.

As for finding another card component, I don’t look forward to the research process. Having to test a number of different components to see which ones I like. Cluttering my hard drive with half a dozen packages that I will never use again, along with the test apps I will need to write to test them with. And if the one I like happens not to be free, having to pay for the licensing for it.

I think that for the short term, I will port the Cards.dll from Windows XP. Just so I can finish the program. Of course, then my target audience will be pre-Vista Windows users ( I am sure that Microsoft would not want the Cards.dll to be bundled with other peoples games).

There is a fourth option. There are Starter Kits for Visual Studio .Net. One of the starter kits is a blackjack card game, and the cards can be adapted for other games. Unfortunately, the cards are not bundled in objects, the way I would want them to be, and so it would be a major effort to make the cards workable for me. Still, if I can get the game working with the old Cards.dll first, perhaps I can come back later and retrofit the starter kit cards into my game.

All the possibilities…


Jun 15 2004

New Download section

I’ve added a download section to the menu bar at the top. The first download I’ve made available is “SevenUp”. This is a four-player (3 computer players, and one human player) card game that I wrote in Delphi. This game was written with very little reuse in mind.

As I have mentioned before, I am in the process of writing a card game library. First, this project is intended to give me some practical experience in writing programs in C#. Second, it is designed to be reusable, so that writing new card games will be much easier with this library.

The first game I plan on writing with this new library is a replacement for the SevenUp game. When that is done, I will place that game in the Download area.


Jun 14 2004

Comment of Vacation

Well, it is now Monday, and not only did I NOT work on my novel, but I did not finish my assignment by Thursday. It seems that my vacation did not attract my muse, after all.

On the plus side, I did make it to the library, to do my research for one of my programming projects. I did not get the answer that I was hoping for (although it was the answer that I expected). At least I know how I will be proceeding from here.


Jun 1 2004

So, what AM I working on?

OK. As I have already said, I am working on a number of projects, from school work, to computer programs, to novels. Here is a more detailed description of my projects.

I have been taking classes at the University of Minnesota for the last 27 years, and I am finally a year away from graduating. Needless to say, I am not one of the types of students that they are proud of. In fact, in an effort to send a wake-up call to us slow-pokes, they have set a deadline, after which, to graduate, we would need to meet current requirements (instead of the requirements set when we enrolled, and which we have been working toward).

So in the interest of finishing up as soon as possible (with a year to spare), I am taking a correspondence course over the summer. My first assignment involves comparing a number of creation myths. I have an idea of what I want to say, and have plotted out about half of the paper. The main problem is forcing myself to sit down and write it. That is where this blog comes in. I figure if I can get myself to sit at the computer and write for this blog, I can work-out my thoughts, and continue on with the paper.

Next is my computer programming. I have been working as a computer programmer for 19 years, and I have found that it is VERY important to keep up to date with the new technologies. Therefore, I am trying to teach myself C# and ASP.NET. First, the C#. I have a little pet project that I first wrote in Delphi, and I have decided to start over from scratch and rewrite it in C#. In Delphi it is a card game named Sevens, or SevenUp (I have it available for download on my web page). In C#, I want to create a Cards development class library, to make it easier to create any card game. I have most of the programming done for the card classes, but have yet to create the rules class.

Another program that I would like to write is a library book management program. I would like to query the local library for information on a book using the barcode on the book. No real great challenges there, just trying to find the time.

And finally, my novel. I have a couple of ideas for books, and I made the mistake of telling one of them to a coworker of mine. She fell in love with it, and wants me to write it, so she can read it. And then, to make matters worse, she gave me an idea for another book. And so I need to spend time on this as well. Although my genre of choice is science fiction, this book is more of a spy thriller, involving a stolen PC, with sensitive information on it, a terrorist plot, and an innocent bystander who can’t seem to shake the people tracking him.

I have been able to start work on the book, but I am not a writer yet, and I still don’t know how to write dialog. At some time, I will make the plunge and start. At that time, I will bring a sample to my friend, and she will be able to critique it for me. So what’s stopping me. Again, maybe this blog will help me. We’ll see.