A part of this game being worked on has an option that you can be asked a random question. If you get it right, it rewards you , but if you get it wrong, you are asked again.. now this is a little not too revealing peice of the code
mob/verb/Ask()
name = "Ask"
var/R = rand(1,20)
if(R == 1)
var/A = input("What does this look like","") as text
if(A == "Bird")
usr << "Correct!"
spawn()
Ask()
else
usr << "Wrong!"
now the problem is. I dont know how to spawn it to the same question again if you get it wrong. I dont want it to start over. Because if i spawn, it will just give you a different random question. I want to know how to respawn the same question when you get it wrong.
ID:147681
![]() Jan 28 2004, 3:49 pm
|
|
I see two obvious solutions. One would be to use GOTO, but that would (of course) be evil, and get many objects thrown at me by certain people.
So, I suggest a list and loop: