...

View Full Version : I need this code dulled down ASAP =]



Asher
11-04-2006, 05:25 PM
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

brandonH
11-04-2006, 05:33 PM
what exactly do you mean? what are you looking for?

and the script you posted looks to be incomplete.... missing vars ect....

_Aerospace_Eng_
11-04-2006, 05:46 PM
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.

Asher
11-05-2006, 06:32 AM
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.

_Aerospace_Eng_
11-05-2006, 08:55 AM
Then why does it need to be dulled down? Who was the client a student? Either way you are still cheating in some way.

Asher
11-05-2006, 11:11 AM
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.

brandonH
11-05-2006, 02:07 PM
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?

Arty Effem
11-05-2006, 02:39 PM
correct = correct + 1When you see a statement like that in JS, you don't have to worry about it looking professional.

_Aerospace_Eng_
11-05-2006, 07:04 PM
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

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?

joh6nn
11-06-2006, 01:37 AM
closing this thread 'cause it seems iffy, and tempers are running high.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum