LINUX.ORG.RU

История изменений

Исправление LINUX-ORG-RU, (текущая версия) :

Теперь все знают!!!

Вот говорят что если посадить много макак за печатную машинку они напечатают шедевор! Посадим одну быструю макаку и подождём пока она напечатает print("hello")

local sprint = print

function print(text)
    sprint(text)
    if text == 'hello' then
       print("Вотетада!")
       os.exit(0)
    end
end

local count = 0
local corre = 0
while(true) do
    local code = {}
    for i=1, #('print("hello")') do
      code[#code+1] = string.char(math.random(32,127))
    end
    code = table.concat(code)
    count = count + 1
    local func,err = load(code)
    if func then
       local success,out = pcall(func)
       if success then
           print('['..count..']'..'['..corre..']  '..code..' <<<<<<<< correct')
           corre = corre + 1
       else
           print('['..count..']'..'['..corre..']  '..code)
       end
    end
end

Попутно будем отслеживать сколько она корректного кода, пусть и бредового, попутно напишет

Исходная версия LINUX-ORG-RU, :

Теперь все знают!!!