944,221 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 15588
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Dec 15th, 2006
0

Looking for help with C++ game of life program. Will pay or make donation for tutor.

Expand Post »
Hi all,

I looking for somebody to help me through a final class program. I would be happy to pay somebody to tutor me through this or make a donation. I am not looking for somebody to just give me the answer, but I DEFINITELY need help. It is due on Monday. Only two people in the entire class have had any success with it. I'm pretty lost. If someone can help me, please let me know. I have all the info pertaining to the assignment. Thanks alot.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nicolivolkov is offline Offline
18 posts
since Dec 2006
Dec 15th, 2006
0

Re: Looking for help with C++ game of life program. Will pay or make donation for tutor.

What's the problem then?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Dec 15th, 2006
0

Re: Looking for help with C++ game of life program. Will pay or make donation for tut

THe actual assignment is 3 pages long with requirements, so I'll just give you the cut and dry version:

Write a program that plays the game of life. Create a class with the name "boolMatrix" for storing and processing a two dimensional array of bool values. We need to read in a dat file that basically contains a pair of coordinates representing the row / col of the locations containing the true values (live cells). the array must be 20 by 20 to start. We need 8 member functions.

This is basically it, with a bunch more specs about whether a cell lives in the future generations and such... The problem is that this is the first time we have used either classes or 2 d arrays and I'm having a terrible time using them together.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nicolivolkov is offline Offline
18 posts
since Dec 2006
Dec 15th, 2006
0

Re: Looking for help with C++ game of life program. Will pay or make donation for tutor.

1. Plan what you think you need to do on paper, i.e NO CODE
2. Draw a flow chart, how does your program go from start to finish?
3. Play with 2d arrays, filling and printing them out.
4. Learn how a basic class can be built.
5. Think about what methods your class will have.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Dec 15th, 2006
0

Re: Looking for help with C++ game of life program. Will pay or make donation for tutor.

When you've actually got some code together post back. Have a go.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Dec 15th, 2006
0

Re: Looking for help with C++ game of life program. Will pay or make donation for tutor.

Well I have spent quite a bit of time working on this... I just don't really understand it and the class is online and the teacher is never available for help. Which is probably why 22 people have dropped. Here's what I've come up with so far. It's not much and I truthfully don't understand exactly where I'm going with it.

Is there a way to attach the entire assgnment?
C++ Syntax (Toggle Plain Text)
  1. #include <iostream>
  2. #include <fstream>
  3. #include "boolMatrix.h"
  4. using namespace std;
  5. const int num_rows = 20;
  6. const int num_cols = 20;
  7. boolMatrix booleanMatrix[row_num][col_num];
  8. int row = 0;
  9. int col = 0;
  10.  
  11.  
  12. boolMatrix::boolMatrix()
  13. {
  14. for(int row = 0; row < num_rows; row++){
  15. for(int col = 0; col < num_cols; col++){
  16. return false;
  17. }
  18. }
  19. }
  20.  
  21.  
  22. boolMatrix boolMatrix::get( boolMatrix booleanMatrix)const
  23. {
  24. return booleanMatrix (row, col);
  25. }
  26.  
  27. void boolmatrix::set (boolMatrix booleanMatrix)
  28. {
  29. ifstream infile("location_alive.dat");
  30. int row, col;
  31.  
  32.  
  33. while(infile){
  34. infile >> row >> col;
  35. booleanMatrix.set(row,col,"TRUE");
  36. }
  37. }
Last edited by ~s.o.s~; Dec 15th, 2006 at 9:47 pm. Reason: Added code tags learn to use them yourself.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nicolivolkov is offline Offline
18 posts
since Dec 2006
Dec 15th, 2006
0

Re: Looking for help with C++ game of life program. Will pay or make donation for tutor.

Please post your code with code tags. See the watermark in the background.

Ok, briefly tell me what all your member functions are for your class and what you expect them to do?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Dec 15th, 2006
0

Re: Looking for help with C++ game of life program. Will pay or make donation for tutor.

At the bottom of the "Advanced reply", you can attach a number of different types of files. And if you do post the code right in your post, please use Code tags. (More info in my sig)

Just a note: you're not allowed to return anything in a class's constructor, which is what you're trying to do in boolMatrix::boolMatrix()

Can't see any more until you post the other files... but it looks good.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Dec 15th, 2006
0

Re: Looking for help with C++ game of life program. Will pay or make donation for tutor.

Also what does BoolMatrix.h look like?

What does your dat file look like.

Post an example please and use code tags.

[edit]I need sleep, I'll be back in the morning.[/edit]

Remember plan it first before you do any coding!
Last edited by iamthwee; Dec 15th, 2006 at 8:01 pm.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Dec 15th, 2006
0

Re: Looking for help with C++ game of life program. Will pay or make donation for tut

Hi ProgrammerJoe,

I uploaded the file, I hope it worked. Please let me know. Inside the main assignment are links to the input file. I'm not sure if they were cut out when I attached though.

I'm not sure what "tags" are. I haven't used them thus far in C++ other CSS HTML and ASP yes, but C++ not sure what they are.

I'm basically stuck at this point.
Attached Files
File Type: doc Project 5.doc (32.5 KB, 213 views)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
nicolivolkov is offline Offline
18 posts
since Dec 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: win32 window painting fails
Next Thread in C++ Forum Timeline: is this matrix code working?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC