ID:261872
 
ok heres the code

and dont read the little // things they are really old

mob/verb/Guess_The_Code(Code2 as text)
//creates a verb called 'Guess_The_Code', lets you type Code1 AND Code2 as a num
if (Code2=="Jake")//if you type in Jake is cool, you get told the following:
world << "Congradulations [usr] cracked the code!"//tells you 'You Cracked The Code!' when both nums are correct
else//if you get the first code right, yet the second is wrong you still lose =)
usr << "I'm sorry, you have failed in cracking the code :( Please try again!"//tells you 'WRONG!'

the problem is that i want it to say if they guessed the first letter, second letter ect. to say you have correctly answered the first letter, second letter ect.

i know this is kinda crazy for me to post two things at once
but my code stinks really bad!
Just look up copytext() in the reference.
if(copytext(Code2, 1,2) == copytext(Code1, 1,2))
world << "You got the first letter right!"
In response to DarkView
var/Answer="Jake"
Guess(Guess)
Guess=lowertext(Guess)
if(Guess==Answer)
usr << "Correct!!!"
return 1
else if(copytext(Guess, 1,2) == copytext(Answer, 1,2))
usr << "You got the first\..."
if(copytext(Guess, 2,3) == copytext(Answer, 2,3))
usr << ", second\..."
if(copytext(Guess, 3,4) == copytext(Answer, 3,4))
usr << ", third\..."
if(copytext(Guess, 4,5) == copytext(Answer, 4,5))
usr << ", forth\..."
usr << " letter right!"
return 0