Difference between revisions of "SL Cert - Scripting Test Reviews"

From Second Life Wiki
Jump to navigation Jump to search
Line 6: Line 6:
'''SL Cert Basic Scripting Example Test'''
'''SL Cert Basic Scripting Example Test'''


#) A script is written in what computer language?
Q1) A script is written in what computer language?
<br>a) html
<br>a) html
<br>b) c++
<br>b) c++
Line 12: Line 12:
<br>d) xml
<br>d) xml


#) Which of the following could a script be used for?
Q2) Which of the following could a script be used for?
<br>a) uploading textures
<br>a) uploading textures
<br>b) uploading audio/media
<br>b) uploading audio/media
Line 18: Line 18:
<br>d) none of the above
<br>d) none of the above


#) What is Mono?
Q3) What is Mono?
<br>a) a form of audio using only one channel
<br>a) a form of audio using only one channel
<br>b) a french soft cheese
<br>b) a french soft cheese
Line 24: Line 24:
<br>d) a database
<br>d) a database


#) What does lsl stand for?
Q4) What does lsl stand for?
<br>a) Lucifers Standard Lemon
<br>a) Lucifers Standard Lemon
<br>b) Linden Scripting Logo
<br>b) Linden Scripting Logo
Line 30: Line 30:
<br>d) Linden Scripting Language
<br>d) Linden Scripting Language


#) What memory would a pre mono script have available?
Q5) What memory would a pre mono script have available?
<br>a) 64k
<br>a) 64k
<br>b) 32k
<br>b) 32k
Line 36: Line 36:
<br>d) 8k
<br>d) 8k


#) When a script is compiled, how does it treat code comments?
Q6) When a script is compiled, how does it treat code comments?
<br>a) causes compile error
<br>a) causes compile error
<br>b) converts them
<br>b) converts them
Line 42: Line 42:
<br>d) highlights them
<br>d) highlights them


#) Consider the following code:-
Q7) Consider the following code:-


<lsl>
<lsl>
Line 79: Line 79:
</lsl>
</lsl>


a) If the above script is placed in an object and that object is rezzed inworld, what would it say as the value of V?
Q7a) If the above script is placed in an object and that object is rezzed inworld, what would it say as the value of V?
<br>a) 100
<br>a) 100
<br>b) 20
<br>b) 20
Line 85: Line 85:
<br>d) 0
<br>d) 0


b) If the above script was reset whilst rezzed in world, what would it say as the value of V?
Q7b) If the above script was reset whilst rezzed in world, what would it say as the value of V?
<br>a) 100
<br>a) 100
<br>b) 20
<br>b) 20
Line 91: Line 91:
<br>d) 0
<br>d) 0


#) Consider the following code:-
Q8) Consider the following code:-


<lsl>
<lsl>
Line 130: Line 130:
</lsl>
</lsl>


a) If the above script is placed in an object and that object is rezzed inworld, what would it say as the value of V?
Q8a) If the above script is placed in an object and that object is rezzed inworld, what would it say as the value of V?
<br>a) 100
<br>a) 100
<br>b) either 0 or 10
<br>b) either 0 or 10
Line 136: Line 136:
<br>d) 0
<br>d) 0


b) If the above script was reset whilst rezzed in world, what would it say as the value of V?
Q8b) If the above script was reset whilst rezzed in world, what would it say as the value of V?
<br>a) 100
<br>a) 100
<br>b) 20
<br>b) 20
Line 142: Line 142:
<br>d) 0
<br>d) 0


c) What would the object say if it were rezzed and then reset?
Q8c) What would the object say if it were rezzed and then reset?
<br>a) 100
<br>a) 100
<br>b) 20
<br>b) 20
Line 149: Line 149:




#) Consider the following code:-
Q9) Consider the following code:-


<lsl>
<lsl>
Line 178: Line 178:
</lsl>
</lsl>


a) When the above script runs what will it say as the value of V?
Q9a) When the above script runs what will it say as the value of V?
<br>a) 3
<br>a) 3
<br>b) 7
<br>b) 7
Line 184: Line 184:
<br>d) 1
<br>d) 1


b) If the line <lsl>llSay(0,"V="+(string)s);</lsl> is changed to <lsl>llSay(0,"V="+(string)v);</lsl> what would it say as the value of V?
Q9b) If the line <lsl>llSay(0,"V="+(string)s);</lsl> is changed to <lsl>llSay(0,"V="+(string)v);</lsl> what would it say as the value of V?
<br>a) 3
<br>a) 3
<br>b) 7
<br>b) 7
Line 190: Line 190:
<br>d) 1
<br>d) 1


c) Keeping the code as per change in #b and altering the line <lsl>v=v+1;</lsl> to <lsl>v*=3;</lsl> what would it say as the value of V?
Q9c) Keeping the code as per change in Q9b and altering the line <lsl>v=v+1;</lsl> to <lsl>v*=3;</lsl> what would it say as the value of V?
<br>a) 3
<br>a) 3
<br>b) 7
<br>b) 7
Line 196: Line 196:
<br>d) 1
<br>d) 1


#) Which of the following is a function?
Q10) Which of the following is a function?
<br>a) (vector)v
<br>a) (vector)v
<br>b) llSay()
<br>b) llSay()
Line 202: Line 202:
<br>d) state_entry()
<br>d) state_entry()


#) Which of the following is an operator?
Q11) Which of the following is an operator?
<br>a) (vector)v
<br>a) (vector)v
<br>b) llSay()
<br>b) llSay()
Line 208: Line 208:
<br>d) state_entry()
<br>d) state_entry()


#) Which of the following is a typecast?
Q12) Which of the following is a typecast?
<br>a) (vector)v
<br>a) (vector)v
<br>b) llSay()
<br>b) llSay()
Line 214: Line 214:
<br>d) state_entry()
<br>d) state_entry()


#) Which of the following is an event?
Q13) Which of the following is an event?
<br>a) (vector)v
<br>a) (vector)v
<br>b) llSay()
<br>b) llSay()
Line 220: Line 220:
<br>d) state_entry()
<br>d) state_entry()


#) Which of the following is a function?
Q14) Which of the following is a function?
<br>a) setup()
<br>a) setup()
<br>b) timer()
<br>b) timer()
Line 226: Line 226:
<br>d) state_entry()
<br>d) state_entry()


#) Consider the following code:-
Q15) Consider the following code:-


<lsl>
<lsl>
Line 249: Line 249:
</lsl>
</lsl>


a) Whats the minimum number of times object containing this script needs to be touched in order to make it say "HELLO!"?
Q15a) Whats the minimum number of times object containing this script needs to be touched in order to make it say "HELLO!"?
<br>a) 1
<br>a) 1
<br>b) 2
<br>b) 2
Line 255: Line 255:
<br>d) 10
<br>d) 10


b) Changing above code <lsl>(v==10 || v==20)</lsl> to <lsl>(v==10 || v!=20)</lsl> Whats the minimum number of times object needs to be touched in order to say "HELLO!"?
Q15b) Changing above code <lsl>(v==10 || v==20)</lsl> to <lsl>(v==10 || v!=20)</lsl> Whats the minimum number of times object needs to be touched in order to say "HELLO!"?
<br>a) 1
<br>a) 1
<br>b) 2
<br>b) 2
Line 261: Line 261:
<br>d) 10
<br>d) 10
          
          
c) Changing above code to <lsl>(v==10 || v<20)</lsl> Whats the minimum number of times object needs to be touched in order to say "HELLO!"?
Q15c) Changing above code to <lsl>(v==10 || v<20)</lsl> Whats the minimum number of times object needs to be touched in order to say "HELLO!"?
<br>a) 1
<br>a) 1
<br>b) 2
<br>b) 2
Line 267: Line 267:
<br>d) 10
<br>d) 10


d) Changing above code to <lsl>(v>4 && (v+1)>5)</lsl> Whats the minimum number of times object needs to be touched in order to say "HELLO!"?
Q15d) Changing above code to <lsl>(v>4 && (v+1)>5)</lsl> Whats the minimum number of times object needs to be touched in order to say "HELLO!"?
<br>a) 1
<br>a) 1
<br>b) 2
<br>b) 2
<br>c) 5
<br>c) 5
<br>d) 10
<br>d) 10

Revision as of 02:17, 23 April 2009

Scripting Test Review Page

SL Cert Basic Scripting Example Test

Q1) A script is written in what computer language?
a) html
b) c++
c) lsl
d) xml

Q2) Which of the following could a script be used for?
a) uploading textures
b) uploading audio/media
c) increasing simulator performance
d) none of the above

Q3) What is Mono?
a) a form of audio using only one channel
b) a french soft cheese
c) an open source scripting engine
d) a database

Q4) What does lsl stand for?
a) Lucifers Standard Lemon
b) Linden Scripting Logo
c) Language Scripting Loop
d) Linden Scripting Language

Q5) What memory would a pre mono script have available?
a) 64k
b) 32k
c) 16k
d) 8k

Q6) When a script is compiled, how does it treat code comments?
a) causes compile error
b) converts them
c) ignores them
d) highlights them

Q7) Consider the following code:-

<lsl>

integer v; default

   {
   on_rez(integer p){
        state run;
   }
   state_entry(){
        v=10;
        state run;
   }
   state_exit(){
        v=100;
   }
   }

state run

   {
   on_rez(integer p){
         llResetScript();
   }
   state_entry(){
       llSay(0,"V="+(string)v);
   }
   }

</lsl>

Q7a) If the above script is placed in an object and that object is rezzed inworld, what would it say as the value of V?
a) 100
b) 20
c) 10
d) 0

Q7b) If the above script was reset whilst rezzed in world, what would it say as the value of V?
a) 100
b) 20
c) 10
d) 0

Q8) Consider the following code:-

<lsl> integer v;

default

   {
   on_rez(integer p){
          state run;
   }
   state_entry(){
          v=10;
          state run;
   }
   }


state run

   {
   on_rez(integer p){
       llResetScript();
   }
   state_entry(){
       llSay(0,"V="+(string)v);
   }
   state_exit(){
         v=100;
   }
   }

</lsl>

Q8a) If the above script is placed in an object and that object is rezzed inworld, what would it say as the value of V?
a) 100
b) either 0 or 10
c) either 10 or 20
d) 0

Q8b) If the above script was reset whilst rezzed in world, what would it say as the value of V?
a) 100
b) 20
c) 10
d) 0

Q8c) What would the object say if it were rezzed and then reset?
a) 100
b) 20
c) 10
d) 0


Q9) Consider the following code:-

<lsl>

integer i=1; float f=1.0; string s="1";

default

   {
   on_rez(integer p){
       llResetScript();
   }
   state_entry()
       {
       integer v=i+(integer)f+(integer)s;
       v=v+1;
       v+=1;
       v++;
       ++v;
       llSay(0,"V="+(string)s);
       }
   }

</lsl>

Q9a) When the above script runs what will it say as the value of V?
a) 3
b) 7
c) 12
d) 1

Q9b) If the line <lsl>llSay(0,"V="+(string)s);</lsl> is changed to <lsl>llSay(0,"V="+(string)v);</lsl> what would it say as the value of V?
a) 3
b) 7
c) 12
d) 1

Q9c) Keeping the code as per change in Q9b and altering the line <lsl>v=v+1;</lsl> to <lsl>v*=3;</lsl> what would it say as the value of V?
a) 3
b) 7
c) 12
d) 1

Q10) Which of the following is a function?
a) (vector)v
b) llSay()
c) !=
d) state_entry()

Q11) Which of the following is an operator?
a) (vector)v
b) llSay()
c) !=
d) state_entry()

Q12) Which of the following is a typecast?
a) (vector)v
b) llSay()
c) !=
d) state_entry()

Q13) Which of the following is an event?
a) (vector)v
b) llSay()
c) !=
d) state_entry()

Q14) Which of the following is a function?
a) setup()
b) timer()
c) on_rez()
d) state_entry()

Q15) Consider the following code:-

<lsl>

integer v;

default

   {
   on_rez(integer p){
         llResetScript();
   }
   touch_start(integer n)
       {
       v+=n;
       if(v==10 || v==20){llSay(0,"HELLO!");}
       }
   }

</lsl>

Q15a) Whats the minimum number of times object containing this script needs to be touched in order to make it say "HELLO!"?
a) 1
b) 2
c) 5
d) 10

Q15b) Changing above code <lsl>(v==10 || v==20)</lsl> to <lsl>(v==10 || v!=20)</lsl> Whats the minimum number of times object needs to be touched in order to say "HELLO!"?
a) 1
b) 2
c) 5
d) 10

Q15c) Changing above code to <lsl>(v==10 || v<20)</lsl> Whats the minimum number of times object needs to be touched in order to say "HELLO!"?
a) 1
b) 2
c) 5
d) 10

Q15d) Changing above code to <lsl>(v>4 && (v+1)>5)</lsl> Whats the minimum number of times object needs to be touched in order to say "HELLO!"?
a) 1
b) 2
c) 5
d) 10