Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Show Off Your Open Source Projects (http://www.programmingforums.org/forum52.html)
-   -   [C++] QTicTac (http://www.programmingforums.org/showthread.php?t=13719)

Jessehk Aug 6th, 2007 7:15 PM

[C++] QTicTac
 
1 Attachment(s)
This is a port of the java version of my final project for a comp. sci. class.

It is written in C++ and makes use of Boost and Qt. I wrote a naive minimax algorithm which seems to do the job nicely.

I tried to be very clear in the code but it is C++ (;)) so I'd be happy to answer any question or clarify things.

It's hosted on googlecode: http://qtictac.googlecode.com

Comments would be awsome. :)

andro Aug 6th, 2007 8:51 PM

Very interesting. My Minimax/Negamax implementation looks a lot different, hehe :)

Jessehk Aug 7th, 2007 3:23 PM

Quote:

Originally Posted by andro (Post 131818)
My Minimax/Negamax implementation looks a lot different, hehe :)

I never claimed I knew what I was talking about. ;)

Jessehk Aug 7th, 2007 11:06 PM

Quote:

Originally Posted by Lisa
[Jumping up and down to get Marge's attention] Look at me! Grade me! Evaluate and rank me! I'm good, good, good and oh so smart! [drops to her knees] Grade meeeeee!!

;) ... Please?

Dameon Aug 7th, 2007 11:37 PM

Only two dimensions?

Let's see a 3x3x3 version ;)

What do you think of Qt?

Jessehk Aug 7th, 2007 11:52 PM

Quote:

Originally Posted by Dameon (Post 131849)

What do you think of Qt?

Well, it was easier then using Swing in Java, that's for sure. Qt has amazing documentation and lots of helpful tutorials and examples

I've never really programmed a GUI before this so I don't really know how it compares overall.
I definitely like the signals and slots mechanism.

Something like this (from my code):
:

connect( uisettings_, SIGNAL( startButtonClicked() ), uiboard_, SLOT( startGame() ) );

is very clear (at least from my POV).

ReggaetonKing Aug 8th, 2007 12:17 AM

Quote:

Originally Posted by Jessehk (Post 131850)
Well, it was easier then using Swing in Java, that's for sure. Qt has amazing documentation and lots of helpful tutorials and examples.

Really? I felt Swing was really easy to use until I hit the JTables :confused:!

How much C++ knowledge would you say someone would need to build (good) GUI apps with Qt?

Jessehk Aug 8th, 2007 12:45 AM

Quote:

Originally Posted by reggaeton_king (Post 131852)
Really? I felt Swing was really easy to use until I hit the JTables :confused:!

There were just too many classes. I didn't like having to make a class that derived from JButton just to do something when it was clicked. ie, a class for a single button that quits the program. A class for a single button that starts the game, etc. Unless I didn't have to do all that, in which case, I'm an idiot. ;)

Quote:

How much C++ knowledge would you say someone would need to build (good) GUI apps with Qt?
Not very much. :) If you know basic C++ (classes, inheritence, dynamic memory, etc) and some good (if not required) conventions such as seperate header files and initializer lists, you'll be fine.

There are tons of in-depth tutorials and examples that are fully explained at the Qt site here http://doc.trolltech.com/4.3/index.html .

ReggaetonKing Aug 8th, 2007 12:48 AM

Quote:

Originally Posted by Jessehk (Post 131855)
There were just too many classes. I didn't like having to make a class that derived from JButton just to do something when it was clicked. ie, a class for a single button that quits the program. A class for a single button that starts the game, etc. Unless I didn't have to do all that, in which case, I'm an idiot. ;)

All you should have done is create a JButton object and add an ActionListener to that object and just call the method(s) you wanted from the actionPerformed() method. lol

Quote:

Originally Posted by Jessehk (Post 131855)
Not very much. :) If you know basic C++ (classes, inheritence, dynamic memory, etc) and some good (if not required) conventions such as seperate header files and initializer lists, you'll be fine.

There are tons of in-depth tutorials and examples that are fully explained at the Qt site here http://doc.trolltech.com/4.3/index.html .

This really seems interesting. I seem to phase out of learning C++ but then I see it used so often, it gets me going again. Like this project you've done! I don't know if my brain can take learning PHP, C#, and C++ at the same time (PHP and C# for job and C++ for fun!).

Jessehk Aug 14th, 2007 5:00 PM

I've added some stuff to the googlecode page at http://code.google.com/p/qtictac/ including an exectuable for x86 Linux and some more screenshots. All you need is Qt >= 4.2.


All times are GMT -5. The time now is 3:01 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC