Thursday, October 23, 2008

Hooray for my brain!

You know that feeling of accomplishment you get when you figure out a difficult problem using your own knowledge of the subject instead of, let's say, looking it up on the internet? Well, that's what I just did.

Here at work, in between being the support guy for a project that is going on here, I am learning how to program in Visual C# just cause it is a useful skill to have. I am currently creating my own version of Monopoly. It's nothing special, no bells and whistles, it's just an exercise in learning this language while incorporating all the things that I am learning. It's certainly much better than just reading a book about learning C#. So, I've got pretty much everything done game-wise, so now I get to add extra things like being able to play against other people on the network. That is what I am working on right now and where my moment of accomplishment comes in. I don't have very much experience in server/client programs, so I had to learn some things in order to implement it. In order to do this, I started off by getting a simple client/server chat program from the internet. This simple program had the user run a server somewhere on the network and then allowed ONE client to connect to it and type things that would then be received by the server. Obviously I would have to allow multiple people to connect to the server, cause a one player game is no fun. So I had to rework what I was given to allow more than one connection to the server while still getting data from all the clients at once. My first attempt at this allowed the clients to connect to the server, but they could only send data one at a time in the order they had connected. This wouldn't do, so I reworked it a little and on my second try, it successfully received data from multiple clients in any order all at once. And I did this working from what I knew about threading, something that I wasn't quite sure of, but think I have a much greater understanding of now.

I'm pretty sure no one knows what I'm talking about and doesn't understand how awesome this makes me feel, but I just felt that I had to share.

1 comment:

Unknown said...

huzzah for learning by doing! Isn't learning fun? Welcome to the world of nerd. Though I guess being a cs person you kind of invented the world of nerd.