|
-
November 28th, 2009, 03:16 PM
#22
Re: My new GoFish thread.
 Originally Posted by Paul McKenzie
Worry about the algorithm and structure of your program first before you talk about the user interface.
Anyway, input should be separated from the actual program engine. If you decide to change this to a GUI program, and if you tightly integrate the input with the GoFish logic, you will have a hard time separating or breaking down your program.
Write a function that returns the valid cards a user can ask for, given what they have. That is the only thing you should do, and again, not try to tightly couple I/O with this. You'll just get yourself in a mess if you mix up I/O with the GoFish logic.
Regards,
Paul McKenzie
Thank you for the great advice. I was thinking this, and it's not REALLY tightly integrated with it. I actually plan to move all the classes to header's and make just an input header to seperate everything (including removing cout in the main logic classes' functions). I was only doing it as a short-term thing. I wanted to finish a project for once, but I definately will take your advice and seperate everything pretty soon. It's still a mess for me. I thought I couldn't return more then one object for a value though? I'll look into that one.. because that was my first though... maybe return a vector / list... but returning mutiple card objects would be EVEN better.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|