ID:167164
 
turf/paper
Click()
switch(alert(usr, "What is Ninjutsu?","Genin Exam #1","A. Hand to hand combat","B. Long range combat","C. Illusionary techniques"))
if("A. Hand to hand combat")
usr << "wrong!"
if("B. Long range combat")
usr << "correct!"
if("C. Illusionary techniques")
usr << "wrong!"


i want to know how to make a code like above and all the correct answers you get will only show after the test ends... *NOT EVERYTIME YOU ANSWER THE CORRECT ANSWER SHOWS UP!*
....

thank you.....
Make a variable that becomes true is they answer correctly. Then when you tell them the correct answer, go back to each question and check for the variable being true.
In response to Pyro_dragons
Pyro_dragons wrote:
Make a variable that becomes true is they answer correctly. Then when you tell them the correct answer, go back to each question and check for the variable being true.

what i mean is that collect all the answers(the answer of the examinee)and show all the correct/wrong answer at the end of the questions..... please can you show me how to do this one... please give an example..... thanks..
In response to VirusE2006
Use a list
In response to Jp
Jp wrote:
Use a list

please give me a example one ....... coz i have no idea how to do what you are talkin guys..

thank you
In response to VirusE2006
I highly suggest reading the dm guide and reference to learn how to code
In response to A.T.H.K
A.T.H.K wrote:
I highly suggest reading the dm guide and reference to learn how to code

i already know and read the dm guide but still cant get it..... im so confuse...
In response to VirusE2006
The weird thing is, when you TRUELY read it, everything is magnificently explained. Maybe some things that are frowned on upon, but everything you need to know is in there. Besides that some logical thinking.
In response to Mysame
Mysame wrote:
The weird thing is, when you TRUELY read it, everything is magnificently explained. Maybe some things that are frowned on upon, but everything you need to know is in there. Besides that some logical thinking.

<small>Wrong, wrong, WRONG! For newbies who are not at all familiar with code compilers, structure, algorithmic design, etc, it is like telling somebody to learn Greek by reading the Greek Dictionary! Even if it had some annotations in English, it's written for people who already understand a good deal of Greek and are looking to expand their knowledge. To focus the analogy, the DM Guide is very useful to somebody who already knows how to write code but is not familiar with the DM syntax and procedures. However, to somebody with no previous experience, it's HARD to read, and when read it endows very little understanding.</small>

Here's a little primer on lists. A list is a set of data structures. Imagine a magical, expanding box. You can always fit at least one thing into it, and you can fit a second thing in there too . . . provided that the second thing is another magical box! That is what the list data structure is like. The structure is often referred to as a pair, or dotted pair.

(a.null) <= there's a box that contains a
(a.(b.null)) <= there's a box that contains a, and a box which in turn contains b.
(a.(b.(c.(d.(e.(f.null)))))) <= I'm not going to write it all out, but you get the point. That is a list containing a,b,c,d,e, and f. The boxes stack inside one another, giving the list its order. In DM, lists are easy to use.

var/list/li = new //create a new list called li
li.Add("a") //add "a" to li. li now looks like this internally: ("a".null)
li.Add(list("b","c","d")) //add more to li. li now looks like this internally:
//("a".("b".("c".("d".null))))
li.Remove("b")
li.Remove("d") //removing b and d gives us list("a","c")
In response to PirateHead
PirateHead,

thanks... but still i have some problem with my "EXAM CODE" and the list thing...

List thing


var/list/li = new //create a new list called li
li.Add("a") //add "a" to li. li now looks like this internally: ("a".null)
li.Add(list("b","c","d")) //add more to li. li now looks like this internally:
//("a".("b".("c".("d".null))))
li.Remove("b")
li.Remove("d") //removing b and d gives us list("a","c")


the code above is the one that you gaved to me.. the problem is how can i use it or where can i put it?...

here is my code:..

EXAM CODE


turf/testpaper
DblClick()
alert(usr, "The Genin Exam.","Instruction")
switch(alert(usr, "What is Genjutsu?","Genin Exam #1","A. Illusionary techniques","B. Long range combat","C. Hand to hand combat"))
if("C. Hand to hand combat")
usr << "<font color=#FF9999 size=0 style=verdana>wrong!"
if("B. Long range combat")
usr << "<font color=#FF9999 size=0 style=verdana>wrong!"
if("A. Illusionary techniques")
usr << "<font color=#FF9999 size=0 style=verdana>correct!"
switch(alert(usr, "What is Taijutsu?","Genin Exam #2","A. Hand to hand combat","B. Long range combat","C. Illusionary techniques"))
if("A. Hand to hand combat")
usr << "<font color=#FF9999 size=0 style=verdana>correct!"
if("B. Long range combat")
usr << "<font color=#FF9999 size=0 style=verdana>wrong!"
if("C. Illusionary techniques")
usr << "<font color=#FF9999 size=0 style=verdana>wrong!"


all i need to know is when you insert the list thing in my "EXAM CODE".. when a certain player answer all the questions and at the end of the test the result will just pop up..... please help me.... to know how to insert the List thing.... or just repost my EXAM CODE and please attach the List thing on it.. thanks..
In response to VirusE2006
Well, I don't feel inclined to fix your EXAM CODE for you, but I hope you can get it figured out. The code I wrote above was a demonstration of the basics with regards to list creation and manipulation.