I need to know the right answer. Please!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lazooo
    New Member
    • May 2007
    • 1

    I need to know the right answer. Please!

    I have the two following questions:

    1. When you write the code you can do it in two different ways. You can write all the code directly in your gameloop or you can break it down in small functions and just call on these from the gameloop. What are the advantages and disadvantages with these two ways of designing a game?

    2. I need this following code corrected and described what is wrong, how it should be (the correct code) and an explanation of what the code is supposed to do:

    function randomize { /*this way you can insert explanations over several lines without the code breaking*/
    randNum = int(math.random ()*60);
    }
    function evalRand(num, count) {
    for(s=o; s<=count;) {
    if(num == myArray[s]) {
    return -1;
    }
    Return(1);
    }



    I'm very thankful for any response
  • kestrel
    Recognized Expert Top Contributor
    • Jul 2006
    • 1071

    #2
    1. Please do not make all of your text bold. If this persists, it may result in a temporary ban. I have changed your text back to normal.
    2. I'm sorry but it is not our job to correct your code and tell you what is wrong with it. Normally, a person presents us with a bit of code and their error code or problem, and we point then in the right direction so that they can solve the problem themselves.

    Comment

    Working...