我以前下了个电梯的东西,可是到现在里面的代码我还是有点看不懂,书我找不到,有没大大好帮帮忙啊,帮我加点中文注释吧(就是这几句话是什么意思啊)
源代码是用按钮控制电梯上下行
我的联系方法是QQ:233255141,邮箱是:knightdgh@126.com
各位大大帮忙啊,我急用~~~
1.这是第一段
uplist:=[]
downlist:=[]
requestlist:=[]
requestlist[1]:=Random(1,8,1)
floor:=requestlist[1]
position:=floor*10
getposition:=0
closedoor:=0
moved:=-1
move:=0
willmove:=-1
start:=0
overloadpower:=0
overload:=0
show:=""
showmove:="↓"
recyclelist:=[]
2.这是第2段
if ListCount(requestlist)>=1 then
DeleteAtIndex(requestlist,1)
end if
if requestlist=[]&uplist=[]&downlist=[] then
requestlist:=[floor]
end if
if moved=1&requestlist=[] then
requestlist:=CopyList(downlist)
downlist:=[]
willmove:=-1
end if
if moved=1&downlist=[]&requestlist=[] then
requestlist:=CopyList(uplist)
uplist:=[]
willmove:=1
end if
if moved=-1&requestlist=[] then
requestlist:=CopyList(uplist)
uplist:=[]
willmove:=1
end if
if moved=-1&requestlist=[]&uplist=[] then
requestlist:=CopyList(downlist)
downlist:=[]
willmove:=-1
end if
closedoor:=ABS(closedoor-1)
showBell:=1
这是源文件(救命啊~.rar)
相关文件(rar):
点这儿打开