lua





local address_num = 6
local recent_num = 6
local m_online_count_ = 20
local total = 6


local address = 0
local recent = 0
local online = 0


local address_flag = 0
local recent_flag = 0
local online_flag = 0


local res = {}


res.a = 1
function select_num(depth,address_num,recent_num, m_online_count_,total )




if total == 0 then
print("0 total " .. total.." address " ..address)


table.insert(res,{address,recent,online})
return
end


if total >0 then




if depth == 1 then


for i = 0,6 do
if address_num >=i then




total = total - i
print("1 total " .. total.." address " ..address)
depth =  depth +1
select_num(depth,address_num,recent_num, m_online_count_,total )
end
end
end


if depth == 2 then


for i = 0,6 do
if recent_num >=0 then


total = total - i
depth =  depth +1
select_num(depth,address_num,recent_num, m_online_count_,total )
end
end
end


if depth ==3 then
for i = 0,6 do
if m_online_count_ >=0 then
m_online_count_ = m_online_count_ - 2
online = online +2
total = total - 2
depth =  depth +1
select_num(depth,address_num,recent_num, m_online_count_,total )
end
end
end


end




select_num(0,address_num,recent_num, m_online_count_,6 )
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值