Yea I did tried google. They mostly have theory on LFGs. If you were able to find some code, then do share.
Type: Posts; User: user_name_void
Yea I did tried google. They mostly have theory on LFGs. If you were able to find some code, then do share.
Does anyone know where I can find the source code of such a generator?
Thanks.
I'm having a little with using the struct. I've got this so far:
struct thread_args
{
char *filename;
int count;
};
All tutorials I've seen, only show examples of passing one argument when using pthread_create(). But I want to call one function concurrently by creating multiple threads. I have to pass things such...
pathY is -1209735804 and pathX is now -1209794033.
At line 337, it has:
pathX = targetX; pathY = targetY;
where targetX is 4 and targetY is 3. However, it seems this assignment never gets done,...
Okay, I have changed line 165 to:
if (a > 0 && b > 0 && a <= grid.map_xy && b <= grid.map_xy)
so that if a and b are out of bounds, then it should not use those values. It no longer seg...
quzah, please elaborate. 'k' is only used in main() as is incremented.
I see that the values of a or b are greater than 100+ when the program crashes (line 252; the array is usually smaller than this). The values are not suppose to exceed the array size. I am unable to...
rags_to_riches, thank you for that quick tutorial. I was able to get some meaningful output, much better than I posted previously.
After running run:
Program received signal SIGSEGV,...
I get this when it seg faults. But it really doesnt help me:
Hey all,
I am having some segmentation issues. Basically main() reads in a text file, and stores the necessary information in a 2d array. It reads and passes the necessary information to...
The while() loop does not modify the x1 and y1 variables which it receives from either grid() or routing(). It only expands the x1 y1 node and passes the expanded nodes as a 2d array to routing()....
Well, I know the if() condition is met because printf("Goal met!") gets executed. Here is some more code that may help pin point the problem.
C pastebin - collaborative debugging tool
Sorry that link is broken. Here is the new one:
C pastebin - collaborative debugging tool
EDIT: Should I post the other functions that call movement() and those which movement() call?
Oh, my apologies. Here is the loop as well as the necessary functions:
http://pastebin.com/d2dd31275
Line 19 is the line in question. Basically this is pathfinder algorithm and movement()...
Here is what I have:
if(x1==x2 && y1==y2) {printf("Goal met!\n"); break;}
Here is where the loop is suppose to break, but it never does so. Even when x1 and x2 and y1 and y2 have the same values....
Okay okay, I've gotten to 2d arrays :shame:
This is Open/Closed list (set) I am referring to:
Implementation notes
doh! I should have seen that. Thanks so much. :)
Thanks laserlight, but I had to do this one using two for() loops.
Hi,
I first set all elements to zero:
for( k = 0; k < asize; k++)
for( j = 0; j < asize; j++)
array_list[k][j] = 0;
I'm working from the source to the goal. So from the initial node, there is only one node to consider, then if possible we expand up, down, left, and right with respect to the initial node. The cost...
I'm using the A* algorithm.
Would the array implementation be used as some sort of queue, like discussed here?
Queue - Array Implementation - Types
Hi,
I'm not sure what data structure I should use, but here is my situation. I'm implementing a path finding algorithm on a 2d grid map (saved as a 2d array). When I expand from one node to...
So have all my elements stored in an integer array. I can start populating my gird map. I have the size of the grip map already (1st line of the input txt file). So I am doing something like this to...
but the array was from 0...5 which was six elements, and now its 0...6 which is 7 elements.
That did the trick! Thank you. I should have known that an array should be of size N+1 for N elements.