Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 6th, 2007, 6:15 PM   #1
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4 Jessehk is on a distinguished road
[C++] QTicTac

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.
Attached Images
File Type: jpg Screenshot-QTicTac.jpg (13.9 KB, 72 views)
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Aug 6th, 2007, 7:51 PM   #2
andro
Professional Programmer
 
Join Date: Oct 2005
Location: California
Posts: 312
Rep Power: 3 andro is on a distinguished road
Send a message via AIM to andro
Very interesting. My Minimax/Negamax implementation looks a lot different, hehe
andro is offline   Reply With Quote
Old Aug 7th, 2007, 2:23 PM   #3
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4 Jessehk is on a distinguished road
Quote:
Originally Posted by andro View Post
My Minimax/Negamax implementation looks a lot different, hehe
I never claimed I knew what I was talking about.
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Aug 7th, 2007, 10:06 PM   #4
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4 Jessehk is on a distinguished road
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?
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Aug 7th, 2007, 10:37 PM   #5
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Only two dimensions?

Let's see a 3x3x3 version

What do you think of Qt?
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Aug 7th, 2007, 10:52 PM   #6
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4 Jessehk is on a distinguished road
Quote:
Originally Posted by Dameon View Post

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).
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Aug 7th, 2007, 11:17 PM   #7
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 3 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
Post

Quote:
Originally Posted by Jessehk View Post
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 !

How much C++ knowledge would you say someone would need to build (good) GUI apps with Qt?
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Aug 7th, 2007, 11:45 PM   #8
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4 Jessehk is on a distinguished road
Quote:
Originally Posted by reggaeton_king View Post
Really? I felt Swing was really easy to use until I hit the JTables !
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 .
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Aug 7th, 2007, 11:48 PM   #9
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 3 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
Quote:
Originally Posted by Jessehk View Post
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 View Post
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!).
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Aug 14th, 2007, 4:00 PM   #10
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4 Jessehk is on a distinguished road
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.
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:57 PM.

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