#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
GUICreate("彩票!",600,520,-1,-1)
GUICtrlCreateLabel("要干掉的号:",10,8,100,17)
Local $str='00 01 03 04 06 07 21 22 24 25 26 27 29 30 31 33 34 35 36 37 39 40 42 43 44 45 46 47 49 51 52 53'; 例子
$Edit1=GUICtrlCreateEdit($str,10,30,580,150,0,0)
GUICtrlCreateLabel("剩下的号:",10,195,100,17)
$Edit2=GUICtrlCreateEdit("",10,220,580,150,0,0)
$button1=GUICtrlCreateLabel("干 掉",10,400,100,50,BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetBkColor(-1, 0xA6CAF0)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button1
_fuck()
EndSwitch
WEnd
Func _fuck()
Local $i,$j,$k,$cha,$tmparr[1]=['xiaochuan']
;总数组
Local $arr_all[10]=['00','01','02','03','04','05','06','07','08','09']
For $k=10 To 99
_ArrayAdd($arr_all,$k)
Next
If GUICtrlRead($Edit1)<>'' Then
$arr=StringSplit(GUICtrlRead($Edit1),' ');要干掉的数组
;要被干掉的每个元素在00-99中的索引,遍历放到一个临时数组中
For $i=1 To $arr[0]
$cha=_ArrayBinarySearch($arr_all,$arr[$i])
If $cha<>-1 Then
_ArrayAdd($tmparr,$cha)
EndIf
Next
;根据刚才的索引,反向遍历,,,,删
For $j=UBound($tmparr)-1 To 1 Step -1
_ArrayDelete($arr_all,$tmparr[$j])
Next
;放到第2个文本框
GUICtrlSetData($Edit2,_ArrayToString($arr_all,' '))
Else
MsgBox(0,'提示','木有数据!!')
EndIf
EndFunc