by Tdarcos » Fri Nov 08, 2019 9:04 am
See if you can figure out what will happen
without compiling. (Okay, I cheated, but if I hadn't tried compiling and running it I'd never have found out what it was doing.)
Code: Select all
verb "x2"
* DoX2
verb "x3"
* DoX3
verb "x2"
* DoX22
verb "x3"
* DoX32
verb "x3"
* DoX33
verb "x4"
* DoX4
outine DoX2
{
"For X2, the first routine was used."
return true
}
routine DoX22
{
"For X2, the second routine was used."
return true
}
routine DoX3
{
"For X3, the first routine was used."
return true
}
routine DoX32
{
"For X3, the second routine was used."
return true
}
routine DoX33
{
"For X3, the third routine was used."
return true
}
routine DoX4
{
"For X4, the first routine was used."
return true
}
Now the questions:
- Which routine does verb X2 call?
- Does X3 compile without error?
- If so, which routine does verb X3 call?
- What is the result if routine DoX4 is changed to replace DoX4
Remember, I already know the answers, I want to see how you think.
See if you can figure out what will happen [i]without[/i] compiling. (Okay, I cheated, but if I hadn't tried compiling and running it I'd never have found out what it was doing.)
[code]
verb "x2"
* DoX2
verb "x3"
* DoX3
verb "x2"
* DoX22
verb "x3"
* DoX32
verb "x3"
* DoX33
verb "x4"
* DoX4
outine DoX2
{
"For X2, the first routine was used."
return true
}
routine DoX22
{
"For X2, the second routine was used."
return true
}
routine DoX3
{
"For X3, the first routine was used."
return true
}
routine DoX32
{
"For X3, the second routine was used."
return true
}
routine DoX33
{
"For X3, the third routine was used."
return true
}
routine DoX4
{
"For X4, the first routine was used."
return true
}
[/code]
Now the questions:[list=1]
[*]Which routine does verb X2 call?
[*]Does X3 compile without error?
[*]If so, which routine does verb X3 call?
[*]What is the result if [size=85]routine DoX4 [/size]is changed to [size=85]replace DoX4[/size][/list]
Remember, I already know the answers, I want to see how you think.