GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 20-Apr-2005, 08:19
eccoflame eccoflame is offline
New Member
 
Join Date: Apr 2005
Posts: 13
eccoflame is on a distinguished road

Urgent Due In 2 Days


this is due in 2 days so i really need help.. and i already stuck

so if some one can manipulate this program below and reply fast like tomorrow
what i mean manipulate is same purpose but using different ways
ok thx

CPP / C++ / C Code:
#include <stdio.h>
#include "initcells.h"

#define PUZZLE 1

void getNumber(int *seed);
void generate(int array[][MAXCELLS]);

int main()
{
   int seed;
   int array[PUZZLE][MAXCELLS];

   getNumber(&seed);
   initCells(array, seed);
   generate(array);

   return 0;
}

void getNumber(int *seed)
{
   /* read in number and do error checking */

   char temp;
   int check;

   do
   {
      printf("Please enter non-zero seed value for the automata : ");
      check = scanf("%d", seed);
      if (check != 1)
      {
         /* clear keyboard buffer */
         do scanf("%c", &temp);
         while (temp != '\n');
      }
   } while (check != 1 || *seed == 0);
}

void generate(int array[][MAXCELLS])
{
   /* all of this code will check the logical expression,
      check the row and collumn
      and print the outcome
   */

   int left, top, right, current, nextgen, nextstate, row, col;

   for (row = 0; row < MAXGEN; row++)
   {
      printf("Gen  %2d ", row + 1);

      for ( col = 0; col < MAXCELLS; col++)
      {
         if ((row + 1) %2 == 0)
         {
            nextgen = 0;
            current = 1;
         }
         else
         {
            nextgen = 1;
            current = 0;
         }

         /* the code below is to read the MAXCELLS
            in addition, it check the left, top and right
            collumn and row */

         if (col == 0)
         {
            left = array[current][MAXCELLS -1];
         }
         else
         {
            left = array[current][col -1];
         }

         top = array[current][col];

         if (col == (MAXCELLS -1))
         {
            right = array[current][0];
         }
         else
         {
            right = array[current][col +1];
         }

         /* this code is to print the result */

         if (array[current][col] == 0)
         {
            printf(" ");
         }
         else
         {
            if (array[current][col] == 1)
            {
               printf(".");
            }
            else
            {
               if (array[current][col] == 2)
               {
                  printf("+");
               }
               else
               {
                  printf("#");
               }
            }
         }

         /* this code is to determine the nextstate */

         if (top == 3)
            nextstate = 0;
         else
            nextstate = top +1;

         /* apply the rule */

         if (left == nextstate || right == nextstate)
         {
            array [nextgen][col] = nextstate;
         }
         else
         {
            if ( left == top && right == top)
            {
               array [nextgen][col] = nextstate;
            }
            else
            {
               array [nextgen][col] = top;
            }
         }
      }
      printf("\n");
   }
}
  #2  
Old 20-Apr-2005, 08:26
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 1,032
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
So... what does your program do? The title: "Urgent Due In 2 Days" isn't really a clue, is it? I'll have to change it, but ... what should I change it to? I have no idea. I'll have to either run it and see what it is doing, or wait until someone else does, helps you, and then I can figure it out.
Can you see my puzzling?

Best regards,
Lucian
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #3  
Old 20-Apr-2005, 09:01
eccoflame eccoflame is offline
New Member
 
Join Date: Apr 2005
Posts: 13
eccoflame is on a distinguished road
Quote:
Originally Posted by LuciWiz
So... what does your program do? The title: "Urgent Due In 2 Days" isn't really a clue, is it? I'll have to change it, but ... what should I change it to? I have no idea. I'll have to either run it and see what it is doing, or wait until someone else does, helps you, and then I can figure it out.
Can you see my puzzling?

Best regards,
Lucian


the program is will generete 20 line of symbol !! i mean to change it is to manipulate the code coz i cannot submit the same one as my friend u got what i mean
  #4  
Old 20-Apr-2005, 10:15
QED's Avatar
QED QED is offline
Member
 
Join Date: Feb 2005
Location: Hudson Valley, NY
Posts: 231
QED is a jewel in the roughQED is a jewel in the roughQED is a jewel in the rough
Quote:
Originally Posted by eccoflame
the program is will generete 20 line of symbol !! i mean to change it is to manipulate the code coz i cannot submit the same one as my friend u got what i mean

Are you saying that you posted your friend's solution to a homework assignment and would like someone to essentially "reword" it for you so that you can have something to hand in that won't look like an exact copy, but with your actually doing any work yourself?

Well, I doubt you'll get much help with that here.

Matthew
  #5  
Old 20-Apr-2005, 18:01
eccoflame eccoflame is offline
New Member
 
Join Date: Apr 2005
Posts: 13
eccoflame is on a distinguished road
Quote:
Originally Posted by QED
Are you saying that you posted your friend's solution to a homework assignment and would like someone to essentially "reword" it for you so that you can have something to hand in that won't look like an exact copy, but with your actually doing any work yourself?

Well, I doubt you'll get much help with that here.

Matthew



it due in one days now so plzzz i really needed...
  #6  
Old 21-Apr-2005, 02:55
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,335
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by eccoflame
it due in one days now so plzzz i really needed...
With what? No one seems to understand the problem you are having. All we seem to understand is you want one of us to rewrite the program for you so you don't have to do any work yourself. I know that's not what you're asking because that's just cheating, so I'm at a loss to suggest anything.
__________________

During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence?
  #7  
Old 21-Apr-2005, 12:06
crystalattice's Avatar
crystalattice crystalattice is offline
Aspiring author
 
Join Date: Apr 2004
Location: Japan (again)
Posts: 1,628
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice
Just an observation: in the time you (eccoflame) have been waiting for someone to do your homework for you, you could have created something on your own. Especially since you apparently already have a very good example to base it on. Now, if you had started on rewriting it and ran into problems, we could have corrected the error and you probably would have it completed by now.

As has already been stated (but it bears repeating), no one will do your work for you. If you have coding problems, we'll do the best we can to help you understand what the problem means and how to fix it; that's the only way you'll learn to program.

But if you want someone to spend his/her personal time writing your homework for you, it's not going to happen. Especially in a case like this when it appears that you're blatantly cheating.

Now, I don't mean to offend if my above assumptions are incorrect, but it appears as though several others on this forum have the same thoughts. If we are all incorrect, please correct us.
__________________
Start Programming with Python-A beginner's guide to programming and the Python language.
-------------
Common Sense v2.0-Striving to make the world a little bit smarter.
  #8  
Old 23-Apr-2005, 18:39
eccoflame eccoflame is offline
New Member
 
Join Date: Apr 2005
Posts: 13
eccoflame is on a distinguished road
ok then sorry
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to create a calendar eleet C Programming Language 4 17-Mar-2005 23:34
Return month by providing work week shinyhui C++ Forum 7 22-Feb-2005 08:23
Problems with switch statement dontcare C++ Forum 4 29-Nov-2004 19:28
need some help formating a display dilmv C++ Forum 6 10-Nov-2004 13:09
Can someone check to see if my program is correct tommy69 C Programming Language 2 12-Apr-2004 21:36

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 10:25.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.