Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Location
    Australia
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation I need this code dulled down ASAP =]

    Hello fellow coding masters and newcomers. I need this code to be dulled down a bit from being a professional code to being more of a school based code. Could anyone please help? I need it done asap.

    thank you, Ash.

    function next () {


    if ( question[id] == "end" ) {
    // if the next question is 'end' then we have no more questions
    // Display the answers and how the user went,

    // Define our var's and give them some default values
    var x=1 ;
    var text = "";
    var total = id-1;
    var correct = 0;
    var money = 100;

    // Text will hold the output we will see
    text = "<h1>Answers:</h1>";

    // Loop through all the questions, from 1 to the current id
    for ( x = 1 ; x < id ; x++ )
    {
    // Append the question, answer and to our output

    text = text + '<h3>Question' + x + "</h3>" ;
    text = text + "Q :: " + question[x] + "<br>"
    text = text + "A :: " + answer[x] + "<br>"
    //text = text + "Guess :: " + guess[x] + "<br>";

    if ( answer[x].toLowerCase() == guess[x].toLowerCase() ) {
    // if the answer is the same as the guess then they are correct

    // Append 'correct' to the output
    text = text + "<div style=\"color:green\"><b>Correct</b></div>";

    // Increment out Correct-o-meter
    correct = correct + 1

    // Double our money! Woot!
    money = money * 2

    }else{
    // if the answer is differant... well they suck

    // Append 'incorrect' to output
    text = text + "<div style=\"color:red\"><b>Incorrect</b></div>";
    }

    // Append some extra spaces
    text = text + "<br>"
    }

    // Append the total score to the output
    text = text + "Your Score: " + correct + "/" + total

    // Append the money won to the output
    text = text + "<br>Your Won: $" + money

    // alert the player how much they have won
    alert("<br>Your Won: $" + money)

    // Sets the main div to contain the output
    document.getElementById('main').innerHTML = text

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    what exactly do you mean? what are you looking for?

    and the script you posted looks to be incomplete.... missing vars ect....
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Ha! It seems like the OP found the code somewhere and is wanting to turn it in for an assignment. I don't think you will get help here to help you cheat.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New to the CF scene
    Join Date
    Sep 2006
    Location
    Australia
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation

    It's not for me. It was for a friend who is doing a texted based game for a client of his. Obviously you should get your facts striaght before you start accusing people of wrong doing. Also, Learn to read the code before saying i stole it idiot.\

    Don't bother replying because you know why?

    //User doesn't care.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Then why does it need to be dulled down? Who was the client a student? Either way you are still cheating in some way.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    New to the CF scene
    Join Date
    Sep 2006
    Location
    Australia
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay. Then you didn't learn javascript yourself. You either got it off a tutorial website, so technically you cheated. So how about you shut up and go look in a different forum thread where someone actually need's help instead of flaming them for some bs excuse you make up at the time..

    Again my coding for this thread..

    //User doesn't care.

  • #7
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    whoa guys! cant we all just get together and bash eachother's brains in? lol no need to bicker about suh things. I do have to say though taht I agree with Aero on that if its a homework assignment, we here at CF shouldn't do it for you. its a homework assignment! should be done by the person. if they were paying attention in class they wouldn have to ask other people how to do it. lol.

    On the other hand I do think Aero jumped to conclusions a bit quickly. We all do that from time to time.

    so the questions still remains.... is is for somone homework assignment or not?

    and my first questions still remains.... what are you looking for exactly?
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #8
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by Asher View Post
    Code:
    correct = correct + 1
    When you see a statement like that in JS, you don't have to worry about it looking professional.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by brandonH View Post
    On the other hand I do think Aero jumped to conclusions a bit quickly. We all do that from time to time.

    so the questions still remains.... is is for somone homework assignment or not?

    and my first questions still remains.... what are you looking for exactly?
    Then why would they even say this
    Quote Originally Posted by OP
    I need this code to be dulled down a bit from being a professional code to being more of a school based code.
    if it wasn't a homework assignment? What would it matter if it was professional or school like?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #10
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    closing this thread 'cause it seems iffy, and tempers are running high.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •