System.irdaInit()
function send(mas,i)
local j=1;
while j<i do
System.irdaWrite(mas[j]);
j=j+1;
end
end
function main()
local i,mas,irda,pad,oldpad=1,{""},"";
while true do
screen:clear();
pad=Controls.read();
irda=System.irdaRead();
if irda~="" then
mas[i]=irda;
i=i+1;
end
for j=1,i do
if mas[j]~="" and mas[j]~=nil then
screen:Print(0,j*10-10,mas[j],Color.new(255,255,255));
end
end
if pad:cross() and oldpad:cross()~=pad:cross() then send(mas,i); end
if pad:start() then break; end if pad:circle() then i=0; end
screen:flip();
oldpad=pad;
end
end
main();