代码拉取完成,页面将自动刷新
function R = m08_moveCar(R,t)
if t<10 || t+8>size(R,2)
return;
end
for i = 1:size(R,1)
area = R(i,t-1);
lane = area;
c10 = 0;
while lane>10
lane = floor(lane/10);
c10 = c10+1;
end
place = area-10^c10*lane;
cantmove = 0;
if area<10 || (lane==7&&place==10) || (lane~=7&&place==1)
continue;
elseif lane==7
strPos = str2double([num2str(lane) num2str(place+1)]);
for j=1:size(R,1)
if R(j,t)==strPos
cantmove = 1;
break;
end
end
if cantmove ==1
continue;
end
if R(i,t)~=R(i,t-8)
continue;
end
R(i,t+10:end) = strPos;
else
strPos = str2double([num2str(lane) num2str(place-1)]);
for j=1:size(R,1)
if R(j,t)==strPos
cantmove = 1;
break;
end
end
if cantmove ==1
continue;
end
if R(i,t-1)~=R(i,t-9) || R(i,t-1)~=R(i,t+8)
continue;
end
R(i,t+10:end) = strPos;
end
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。