Here is a code example for prospective QuakeC coders, as well as some "interview questions" for it:
And now the questions:
If you can figure this out without knowing QuakeC, you may be a good match for our team!
Code:
.string classname;
.string netname;
void func()
{
entity e;
e = spawn();
e.classname = "foo";
e.netname = "This ";
e = spawn();
e.classname = "foo";
e.netname = "is ";
e = spawn();
e.classname = "bar";
e.netname = "not ";
e = spawn();
e.classname = "foo";
e.netname = "working.\n";
for(e = world; (e = find(e, classname, "foo")); )
print(e.netname);
}
And now the questions:
- What does func() output when nothing else has been run yet?
- Write the for loop as an equivalent while loop.
- What, do you think, may the three arguments to find() mean? What does find() return?
- What happens when calling func() a second time?
- Why does it do that?
- Doesn't this indicate some sort of memory leak?
- How do you suggest fixing it?
- Why does it do that?
If you can figure this out without knowing QuakeC, you may be a good match for our team!
BRLOGENSHFEGLE (core dumped)
The Bot Orchestra is back! | Xoylent Easter Egg | 5bots1piano
My music on Google Play and SoundCloud
The Bot Orchestra is back! | Xoylent Easter Egg | 5bots1piano
My music on Google Play and SoundCloud