Evan
Evan - 认证专家

注册于 5年前

回答
310
文章
36
关注者
39

不知道你说的随机迭代是什么意思.姑且按照随机打乱数组顺序吧.

function randomTable(_table, _num) 
  local _result = {}
  local _index = 1
  local _num = _num or #_table
  while #_table ~= 0 do
      local ran = math.random(0, #_table)
      if _table[ran] ~= nil then
          _result[_index] = _table[ran]
          table.remove(_table,ran)
          _index = _index + 1
          if _index > _num then 
              break
          end 
      end
  end
  return _result
end
function copy_table(ori_tab)
    if type(ori_tab) ~= "table" then
        return
    end
    local new_tab = {}
    for k, v in pairs(ori_tab) do
        local vtype = type(v)
        if vtype == "table" then
            new_tab[k] = copy_table[v]
        else
            new_tab[k] = v
        end
    end
    return new_tab
end
function main()
  t = {"a","b","c","d","e","f","g"}
  f = randomTable(copy_table(t))
  logDebug(table.concat(t,','))
  logDebug(table.concat(f,','))
end

然后按顺序输出新数组f 就等于是随机t数组的内容且不重复了

此问题确实存在,无奈pro太贵了...

服务器上用php之类的写一个删除,脚本httpget这个php实现删除

在抬起之前加点短距离移动试试
touchMove(0,x2,y2-1);
mSleep(100);
touchMove(0,x2,y2);
touchUp(0);

doc.touchelf.com 这个文档跟目前的触摸是一致的.

os.execute("killall BirdFaker") 可使用这个代码关闭应用

找了一台10系统手机测试并没有你说的问题,你检查下是否有插件冲突之类的吧

苹果还是安卓.3.5是多少年以前的版本了,升级5.0以上再试吧

触摸版本?测试过连续48小时识别没死机

发布
问题