|
这段代码第一次运行结果正确,第二次以后结果就是错误,关闭脚本重新开启运行又是正确的
哪个高人帮忙看下是不是变量作用域的问题
code]Case $msg = $button1
Dim $a=$data
Local $x,$y,$x1,$y1
$x =GUICtrlRead($Input1)
$y =GUICtrlRead($Input2)
$x1 =GUICtrlRead($Input3)
$y1=GUICtrlRead($Input4)
$x =_converx1($x,$y)
$y =_convery1($x,$y)
$x1=_converx1($x1,$y1)
$y1=_convery1($x1,$y1
If $data[ $x][$y]<>"x" or $data[ $x1][$y1]<>"x" Then
MsgBox(0,"错误","错误")
Else
$data[ $x][$y]="s"
$data[ $x1][$y1]="g"
Local $start[2]=[$x,$y]
Local $goal[2]=[$x1,$y1]
_Create($data, $cols, $rows)
Dim $b = _Find($data, $data[$start[0]][$start[1]], $data[$goal[0]][$goal[1]])
_ArrayDisplay($b)
EndIf
$data =$a[/code] |
|