level 1
脚本实例教程连载六 while循环 中文注释版
while
while 循环的例子.猜猜能循环几次?// Code by Felix xu of www.slbazar.com
default
//默认状态
{
state_entry()
//状态开始时运行 下面{}中内容
{
llSay(0, "Compile Successful!");
//对着 0频道 说"Compile Successful!"
//0频道是 大家平常聊天时候用的频道 具体有多少个频道 可以看林登脚本语言指南 至少有6位数
}
touch_start(integer total_number)
//触摸开始
{
integer count = 1;
//声明: (造出来一个) 整数类型 的变量 count 值是 1
integer maxcount = 3;
//声明: (造出来一个) 整数类型 的变量 maxcount 值是 3
while (count < maxcount)
// while是循环 当后面()中的内容 成立时候 就运行 下面{}里的内容
//此处 count < maxcount 就 运行 {}
{
llSay(0,"I'm repeating myself");
//ll说(0频道,"I'm repeating myself")
count = count + 1;
//变量 count 每次都+1 也可写为 count++
}
}
}
2009年01月10日 09点01分