yo!
things are looking up. all the errors are gone but two:
[linker error] undefined reference to 'randn' // i think this has something to do with the include statements at the begginging//
and
id returned 1 exit status.
Check the one i posted again. I changed the rand() thing.
That error is actually nothing to do with the include files. It means the code for randn cannot be found (its probably from some lib you need to link). This error shoudnt occur if you use the one i posted.
I think the second part is "ld" not "id" - which is the linker stage failed - because it can't find a function called randn - you may want to try rand() instead.
You may want to give gcc (the compiler) the switch "-Wall" to give you warnings, that will help you get some more information on things that you do wrong, earlier, rather than at the linker stage, where for example which line the error was on is lost.
--
Mats
how do i switch wall.
also i changed to rand and am getting:
in function 'fight'
to many arguments to function rand.
I updated the fixed code...it works..try it.
You should read all the replies posted since you last read the topic, not just the last reply.
I don't know how you set switches in the Dev environment - somewhere you'll be able to change your settings for how the compiler is called, and you need to say "Give me warnings" there.
rand() gives you a value within a range 0..RAND_MAX, the latter being a large number. If you use % X where X is one more than the highest number you want, e.g.--Code:r = rand() % 10; // Numbers 0..9 r = rand() % 10 + 1 // 1..10 r = rand() % 300; // 0..300
Mats