2
Метатабличный / Говнокод #26853
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
if thr < 0.1 then
one()
elseif thr > 0.1 and thr < 0.2 then
one()
two()
elseif thr > 0.2 and thr < 0.3 then
one()
two()
three()
elseif thr > 0.3 and thr < 0.4 then
one()
two()
three()
four()
elseif thr > 0.4 and thr < 0.5 then
one()
two()
three()
four()
five()
elseif thr > 0.5 and thr < 0.6 then
one()
two()
three()
four()
five()
six()
elseif thr > 0.6 and thr < 0.7 then
one()
two()
three()
four()
five()
six()
seven()
elseif thr > 0.7 and thr < 0.8 then
one()
two()
three()
four()
five()
six()
seven()
eight()
elseif thr > 0.8 and thr < 0.9 then
one()
two()
three()
four()
five()
six()
seven()
eight()
nine()
elseif thr > 0.9 and thr < 1 then
one()
two()
three()
four()
five()
six()
seven()
eight()
nine()
ten()
elseif thr == 1 then
one()
two()
three()
four()
five()
six()
seven()
eight()
nine()
ten()
eleven()
end
........
function one()
screen.setColor(0, 255, 0)
screen.drawRectF(12, 53, 4, 5)
end
function two()
screen.setColor(0, 255, 0)
screen.drawRectF(16, 53, 4, 5)
end
function three()
screen.setColor(0, 255, 0)
screen.drawRectF(20, 53, 4, 5)
end
function four()
screen.setColor(0, 255, 0)
screen.drawRectF(24, 53, 4, 5)
end
Говнокод для рисования полоски загрузки
Метатабличный / Говнокод #26683
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
if number >= 0 and number <= 9 then
string.format('00%d', number)
end
if number >= 10 and number <= 99 then
string.format('0%d', number)
end
if number >= 100 and number <= 999 then
string.format('%d', number)
end
Метатабличный / Говнокод #26519
0
- 1
- 2
- 3
https://github.com/xexpanderx/conky-drawer-interactive/tree/master/lua
а вы тоже храните автосейв файлы редактора на гитхабе?
https://github.com/xexpanderx/conky-drawer-interactive/blob/master/lua/drawer.lua
cairo_arc(cr,hdd_x+22, hdd_y-5,10,270*math.pi/180,360*math.pi/180)
cairo_arc(cr, hdd_x+22, hdd_y-5+28,10,0*math.pi/180,90*math.pi/180)какая геометрия :))
Метатабличный / Говнокод #26361
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
-- ввод
io.write('Введите число: ')
x=tonumber(io.read())
-- проверка
-- 1-я часть
pro=0
e=true
io.write("0")
for i=1,x do
if e then
io.write(' + '..i)
pro = pro+i
else
io.write(' - '..i)
pro = pro-i
end
e = not e
end
print(" = "..pro)
a1 = pro
-- 2-я часть
pro=1
e=true
for i=1,x-1,2 do io.write('(') end
io.write("1")
for i=1,x do
if e then
io.write(' + '..i)
pro = pro+i
else
io.write(')/'..i)
pro = pro/i
end
e = not e
end
print(" = "..pro)
a2 = pro
------------------------------
if (a1<0 and a2==1) then print('Число четное')
elseif (a1>=0 and a2~=1) then print('Число нечетное')
end
Проверка четности числа (работает для чисел >= 1)
Метатабличный / Говнокод #26249
0
- 1
- 2
Я ЕБУ СОБАК, ВСЕГДА ГОТОВ СРАЗУ ТРАХАТЬ НЕСКОЛЬКО КОТОВ
ДА Я ЗООФИЛ НЕ ГОВОРИ ЛУЧШЕ МНЕ СОБАЧЕК ПОДАРИ
Я ЕБУ СОБАК, ВСЕГДА ГОТОВ СРАЗУ ТРАХАТЬ НЕСКОЛЬКО КОТОВ
ДА Я ЗООФИЛ НЕ ГОВОРИ ЛУЧШЕ МНЕ СОБАЧЕК ПОДАРИ
Метатабличный / Говнокод #26240
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
Метатабличный / Говнокод #26228
0
- 1
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
Метатабличный / Говнокод #26224
0
- 1
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
Метатабличный / Говнокод #25987
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
local money = 0
local auto_money = 0
local auto_money_lvl = 0
local auto_money_buy = 50
local bonus_money_lvl = 0
local bonus_money_buy = 35
local json_pip = require("json")
local bacg = display.newRect(0,0,1080,1920)
local button = display.newRect(160,190,175,175)
button:setFillColor(0,0.4,0.3)
local button_auto = display.newRect(70,400,111,111)
button_auto:setFillColor(0,0.4,0.3)
local button_bonus = display.newRect(250,400,111,111)
button_bonus:setFillColor(0,0.4,0.3)
local text = display.newText("Click", 161, 190, "consolas", 30)
text:setFillColor(1,1,1)
local text1 = display.newText("Money:", 64, -19, "consolas", 30)
text1:setFillColor(0,0.1,0.8)
local text2 = display.newText(money, 200, -16, "consolas", 30)
text2:setFillColor(0,0.1,0.8)
local text3 = display.newText("Auto", 70, 370, "consolas", 30)
text3:setFillColor(1,1,1)
local text4 = display.newText("click", 70, 400, "consolas", 30)
text4:setFillColor(1,1,1)
local text5 = display.newText(auto_money_buy, 70, 437, "consolas", 30)
text5:setFillColor(1,1,1)
local text6 = display.newText("Bonus", 250, 370, "consolas", 30)
text6:setFillColor(1,1,1)
local text7 = display.newText("click", 250, 400, "consolas", 30)
text7:setFillColor(1,1,1)
local text8 = display.newText(bonus_money_buy, 250, 437, "consolas", 30)
text8:setFillColor(1,1,1)
ocal button_shadow = display.newRect(160,280,175,10)
button_shadow:setFillColor(0,0.3,0.4)
local button_shadow_auto = display.newRect(70,460,111,10)
button_shadow_auto:setFillColor(0,0.3,0.4)
local button_shadow_bonus = display.newRect(250,460,111,10)
button_shadow_bonus:setFillColor(0,0.3,0.4)
local copyright = display.newText("KernelCoreSW 2018-2019", 163, 490, "consolas", 23)
copyright:setFillColor(0,0.1,0.8)
local function flapBird (event)
if(event.phase == "began") then
---lvl
if(bonus_money_lvl == 0) then
money = money + 1
end
if(bonus_money_lvl == 1) then
money = money + 2
end
--И еще такого говнаролла штук 10
text2.text = money
end
local function flapBird_bonus (event)
if(event.phase == "began") then
if(money >= bonus_money_buy) then
money = money - bonus_money_buy
bonus_money_buy = bonus_money_buy * 3
bonus_money_lvl = bonus_money_lvl + 1
end
text2.text = money
text8.text = bonus_money_buy
end
end
local function onUpdate (args)
if(auto_money > 40) then
auto_money = 0
end
---------levels
if(auto_money_lvl == 1) then
if(auto_money == 40) then
money = money + 1
text2.text = money
end
end
---------levels end и еще такого говна штук 10
auto_money = auto_money + 1
end
local function load_settings(fileName)
local path = system.pathForFile(fileName, system.ResourceDirectory)
local contents = ""
local myTable = {}
local file = io.open(path, "r")
if(file) then
contents = file:read("*a")
myTable = json.decode(contents)
io.close(file)
return myTable
end
return nil
end
local settings = loadSettings("settings.json")
if(settings) then
money = settings.money
auto_money = settings.auto_money
auto_money_buy = settings.auto_money_buy
auto_money_lvl = settings.auto_money_lvl
bonus_money_lvl = settings.bonus_money_lvl
bonus_money_buy = settings.bonus_money_buy
end
button:addEventListener("touch", flapBird)
button_auto:addEventListener("touch", flapBird_auto)
button_bonus:addEventListener("touch", flapBird_bonus)
Runtime:addEventListener("enterFrame", onUpdate)
Гейдев.
Метатабличный / Говнокод #25853
0
- 1
Ня, пока.
Пароль: 123456654321123456
Метатабличный / Говнокод #25829
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
if self.Weapon:GetNextPrimaryFire() < CurTime() then
if GetConVarNumber( "ma2_togglechargeui" ) == 1 then
if (self.Charge-self.DmgMin)/self.DmgMax*100<=10 then
ply:SetNWString("chargebar","██")
elseif (self.Charge-self.DmgMin)/(self.DmgMax-self.DmgMin)*100<=20 then
ply:SetNWString("chargebar","████")
elseif (self.Charge-self.DmgMin)/(self.DmgMax-self.DmgMin)*100<=30 then
ply:SetNWString("chargebar","██████")
elseif (self.Charge-self.DmgMin)/(self.DmgMax-self.DmgMin)*100<=40 then
ply:SetNWString("chargebar","████████")
elseif (self.Charge-self.DmgMin)/(self.DmgMax-self.DmgMin)*100<=50 then
ply:SetNWString("chargebar","██████████")
elseif (self.Charge-self.DmgMin)/(self.DmgMax-self.DmgMin)*100<=60 then
ply:SetNWString("chargebar","████████████")
elseif (self.Charge-self.DmgMin)/(self.DmgMax-self.DmgMin)*100<=70 then
ply:SetNWString("chargebar","██████████████")
elseif (self.Charge-self.DmgMin)/(self.DmgMax-self.DmgMin)*100<=80 then
ply:SetNWString("chargebar","████████████████")
elseif (self.Charge-self.DmgMin)/(self.DmgMax-self.DmgMin)*100<=90 then
ply:SetNWString("chargebar","██████████████████")
elseif (self.Charge-self.DmgMin)/(self.DmgMax-self.DmgMin)*100>90 then
ply:SetNWString("chargebar","████████████████████")
ply:SetNWBool("chargemaxxxed",true)
end
end
end
https://steamcommunity.com/sharedfiles/filedetails/?id=1825542758
Метатабличный / Говнокод #25804
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠
⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
⌠⌡ СМС бомбер на любой номер с любым текстом и поддельным отправителем всего за 0,99р -> https://bit.ly/2XSMAfW
Метатабличный / Говнокод #25726
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
Есть случаи когда нужно 2 вызывать сборку помойки...
A = {x = "this is A"}
B = {f = A}
setmetatable(B, {__gc = function (o) print(o.f.x) end})
A, B = nil
collectgarbage() -- this is A
Роберту это называет Воскресение (Воскрешение)
https://stackoverflow.com/questions/28320213/why-do-we-need-to-call-luas-collectgarbage-twice
Метатабличный / Говнокод #25710
0
- 1
- 2
Я долгие годы вел наблюдение. И я могу сделать уверенное заявление.
Lure Of Chaos это златохуй.
Метатабличный / Говнокод #25667
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
gr = love.graphics
win = love.window
lk = love.keyboard
require("button")
require("t")
function love.load()
local loading = {}
loading = serialize.load("records.lua")
font = gr.newFont("NotoSans.ttf",14)
mini = gr.newFont("NotoSans.ttf",10)
big = gr.newFont("NotoSans.ttf",30)
flag = nil --Flag = nil -menu, Flag = 1 -records, Flag = 2 -type game, Flag = 3 -type game standart, Flag = 4 -type game impulse, Flag = 5 -type game Invers, Flag = 6 -type game Unreal
kube = {x = 96, y = 196, colx = 8, coly = 8}
speed = 1
timer = 0
umber = {}
records = {{"Standart", 0},{"Impulse", 0},{"Invers", 0},{"Unreal", 0},{"XY diagonal", 0},{"Perpendiculars", 0}}
if loading and #loading > 0 then
for i = 1, #loading do
records[i][2] = loading[i]
end
end
score = 0
mb = {utton:create(200-font:getWidth(">Play<")/2,125,">Play<"),utton:create(200-font:getWidth(">Records<")/2,160,">Records<"),utton:create(200-font:getWidth(">Exit<")/2,195,">Exit<")}
tgb = {utton:create(200-font:getWidth(">Standart<")/2,60,">Standart<"),utton:create(200-font:getWidth(">Impulse<")/2,90,">Impulse<"),utton:create(200-font:getWidth(">Invers<")/2,120,">Invers<"),utton:create(200-font:getWidth(">Unreal<")/2,150,">Unreal<"),utton:create(200-font:getWidth(">XY diagonal<")/2,180,">XY diagonal<"),utton:create(200-font:getWidth(">Perpendiculars<")/2,210,">Perpendiculars<")}
back = utton:create(200-font:getWidth(" >Back< ")/2,300," >Back< ")
r = utton:create(200-font:getWidth(" >Restart< ")/2,250," >Restart< ")
end
local function restart()
kube = {x = 96, y = 196, colx = 8, coly = 8, speed = 350}
speed = 1
timer = 0
umber = {}
score = 0
toch = nil
end
My первый игра сделаная на love2d. Аж всплакнул.
Метатабличный / Говнокод #25633
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
utf8 = {}
function utf8.charbytes(s, i)
-- argument defaults
i = i or 1
local c = string.byte(s, i)
-- determine bytes needed for character, based on RFC 3629
if c > 0 and c <= 127 then
-- UTF8-1
return 1
elseif c >= 194 and c <= 223 then
-- UTF8-2
local c2 = string.byte(s, i + 1)
return 2
elseif c >= 224 and c <= 239 then
-- UTF8-3
local c2 = s:byte(i + 1)
local c3 = s:byte(i + 2)
return 3
elseif c >= 240 and c <= 244 then
-- UTF8-4
local c2 = s:byte(i + 1)
local c3 = s:byte(i + 2)
local c4 = s:byte(i + 3)
return 4
end
end
function utf8.len(s)
local pos = 1
local bytes = string.len(s)
local len = 0
while pos <= bytes and len ~= chars do
local c = string.byte(s,pos)
len = len + 1
pos = pos + utf8.charbytes(s, pos)
end
if chars ~= nil then
return pos - 1
end
return len
end
print(utf8.len("Аутизм")) --6
local mt = {__len = function(self)
local k=0
for _,v in pairs(self) do
k = k+1;
if k > 1 then print(1) return #self end
end
if k==1 and type(self[1])=="string" then
print(utf8.len(self[k]))
end
end};
setmetatable(_G,{
__index = function(self, key) return setmetatable({key},mt) end}
)
t=(#Аутизм) --12
Чот пытался - но словил хуйца.
Метатабличный / Говнокод #25346
0
- 1
- 2
- 3
do debug.getinfo(1).func() end --рекурсия
do debug.getinfo(2).func() end --вылет нахуй интерпретатора 5.3 версии без ошибки.
do debug.getinfo(3).func() end --не существует с таким индексом. Ошибка.
Метатабличный / Говнокод #25272
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
-- Pipe Elbow ****************************************************************************
pipe_elbow = util.table.deepcopy(data.raw["storage-tank"]["storage-tank"])
pipe_elbow.name = "pipe-elbow"
pipe_elbow.icon = "__Flow Control__/graphics/icon/pipe-elbow.png"
pipe_elbow.minable = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].minable
pipe_elbow.corpse = "small-remnants"
pipe_elbow.max_health = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].max_health
pipe_elbow.resistances = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].resistances
pipe_elbow.fast_replaceable_group = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].fast_replaceable_group
pipe_elbow.collision_box = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].collision_box
pipe_elbow.selection_box = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].selection_box
Пип Еблов.
Factorio mod Flow Control_3.0.3
--Завышеное ЧСВ или самолюбование?
Метатабличный / Говнокод #25192
0
- 1
Ухожу от вас
Ухожу от вас
Метатабличный / Говнокод #25016
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
class Person {
protected name: string;
constructor(name: string) { this.name = name; }
}
class Employee extends Person {
private department: string;
constructor(name: string, department: string) {
super(name);
this.department = department;
}
public get ElevatorPitch() {
return `Hello, my name is ${this.name} and I work in ${this.department}.`;
}
}
let howard = new Employee("Howard", "Sales");
console.log(howard.ElevatorPitch);
наговнокодил компайлер TypeScript для Lua для тех кто терпеть не может
такой говноязык как Lua но в экстазе от говно Vm от Lua 5.3
https://github.com/ASDAlexander77/TypeScriptLUA
Закомпили тестовый файл:
node __out/main.js test.ts
Теперь можно эту лажу запустить
lua test.lua
Метатабличный / Говнокод #26853
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
if thr < 0.1 then
one()
elseif thr > 0.1 and thr < 0.2 then
one()
two()
elseif thr > 0.2 and thr < 0.3 then
one()
two()
three()
elseif thr > 0.3 and thr < 0.4 then
one()
two()
three()
four()
elseif thr > 0.4 and thr < 0.5 then
one()
two()
three()
four()
five()
elseif thr > 0.5 and thr < 0.6 then
one()
two()
three()
four()
five()
six()
elseif thr > 0.6 and thr < 0.7 then
one()
two()
three()
four()
five()
six()
seven()
elseif thr > 0.7 and thr < 0.8 then
one()
two()
three()
four()
five()
six()
seven()
eight()
elseif thr > 0.8 and thr < 0.9 then
one()
two()
three()
four()
five()
six()
seven()
eight()
nine()
elseif thr > 0.9 and thr < 1 then
one()
two()
three()
four()
five()
six()
seven()
eight()
nine()
ten()
elseif thr == 1 then
one()
two()
three()
four()
five()
six()
seven()
eight()
nine()
ten()
eleven()
end
........
function one()
screen.setColor(0, 255, 0)
screen.drawRectF(12, 53, 4, 5)
end
function two()
screen.setColor(0, 255, 0)
screen.drawRectF(16, 53, 4, 5)
end
function three()
screen.setColor(0, 255, 0)
screen.drawRectF(20, 53, 4, 5)
end
function four()
screen.setColor(0, 255, 0)
screen.drawRectF(24, 53, 4, 5)
end
Говнокод для рисования полоски загрузки
Метатабличный / Говнокод #26683
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
if number >= 0 and number <= 9 then
string.format('00%d', number)
end
if number >= 10 and number <= 99 then
string.format('0%d', number)
end
if number >= 100 and number <= 999 then
string.format('%d', number)
end
Метатабличный / Говнокод #26519
0
- 1
- 2
- 3
https://github.com/xexpanderx/conky-drawer-interactive/tree/master/lua
а вы тоже храните автосейв файлы редактора на гитхабе?
https://github.com/xexpanderx/conky-drawer-interactive/blob/master/lua/drawer.lua
cairo_arc(cr,hdd_x+22, hdd_y-5,10,270*math.pi/180,360*math.pi/180)
cairo_arc(cr, hdd_x+22, hdd_y-5+28,10,0*math.pi/180,90*math.pi/180)какая геометрия :))
Метатабличный / Говнокод #26361
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
-- ввод
io.write('Введите число: ')
x=tonumber(io.read())
-- проверка
-- 1-я часть
pro=0
e=true
io.write("0")
for i=1,x do
if e then
io.write(' + '..i)
pro = pro+i
else
io.write(' - '..i)
pro = pro-i
end
e = not e
end
print(" = "..pro)
a1 = pro
-- 2-я часть
pro=1
e=true
for i=1,x-1,2 do io.write('(') end
io.write("1")
for i=1,x do
if e then
io.write(' + '..i)
pro = pro+i
else
io.write(')/'..i)
pro = pro/i
end
e = not e
end
print(" = "..pro)
a2 = pro
------------------------------
if (a1<0 and a2==1) then print('Число четное')
elseif (a1>=0 and a2~=1) then print('Число нечетное')
end
Проверка четности числа (работает для чисел >= 1)
Метатабличный / Говнокод #26249
0
- 1
- 2
Я ЕБУ СОБАК, ВСЕГДА ГОТОВ СРАЗУ ТРАХАТЬ НЕСКОЛЬКО КОТОВ
ДА Я ЗООФИЛ НЕ ГОВОРИ ЛУЧШЕ МНЕ СОБАЧЕК ПОДАРИ
Я ЕБУ СОБАК, ВСЕГДА ГОТОВ СРАЗУ ТРАХАТЬ НЕСКОЛЬКО КОТОВ
ДА Я ЗООФИЛ НЕ ГОВОРИ ЛУЧШЕ МНЕ СОБАЧЕК ПОДАРИ
Метатабличный / Говнокод #26240
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
Метатабличный / Говнокод #26228
0
- 1
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
Метатабличный / Говнокод #26224
0
- 1
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
СТРАЙКЕР СОСЁТ МОЙ ХУЙ
Метатабличный / Говнокод #25987
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
local money = 0
local auto_money = 0
local auto_money_lvl = 0
local auto_money_buy = 50
local bonus_money_lvl = 0
local bonus_money_buy = 35
local json_pip = require("json")
local bacg = display.newRect(0,0,1080,1920)
local button = display.newRect(160,190,175,175)
button:setFillColor(0,0.4,0.3)
local button_auto = display.newRect(70,400,111,111)
button_auto:setFillColor(0,0.4,0.3)
local button_bonus = display.newRect(250,400,111,111)
button_bonus:setFillColor(0,0.4,0.3)
local text = display.newText("Click", 161, 190, "consolas", 30)
text:setFillColor(1,1,1)
local text1 = display.newText("Money:", 64, -19, "consolas", 30)
text1:setFillColor(0,0.1,0.8)
local text2 = display.newText(money, 200, -16, "consolas", 30)
text2:setFillColor(0,0.1,0.8)
local text3 = display.newText("Auto", 70, 370, "consolas", 30)
text3:setFillColor(1,1,1)
local text4 = display.newText("click", 70, 400, "consolas", 30)
text4:setFillColor(1,1,1)
local text5 = display.newText(auto_money_buy, 70, 437, "consolas", 30)
text5:setFillColor(1,1,1)
local text6 = display.newText("Bonus", 250, 370, "consolas", 30)
text6:setFillColor(1,1,1)
local text7 = display.newText("click", 250, 400, "consolas", 30)
text7:setFillColor(1,1,1)
local text8 = display.newText(bonus_money_buy, 250, 437, "consolas", 30)
text8:setFillColor(1,1,1)
ocal button_shadow = display.newRect(160,280,175,10)
button_shadow:setFillColor(0,0.3,0.4)
local button_shadow_auto = display.newRect(70,460,111,10)
button_shadow_auto:setFillColor(0,0.3,0.4)
local button_shadow_bonus = display.newRect(250,460,111,10)
button_shadow_bonus:setFillColor(0,0.3,0.4)
local copyright = display.newText("KernelCoreSW 2018-2019", 163, 490, "consolas", 23)
copyright:setFillColor(0,0.1,0.8)
local function flapBird (event)
if(event.phase == "began") then
---lvl
if(bonus_money_lvl == 0) then
money = money + 1
end
if(bonus_money_lvl == 1) then
money = money + 2
end
--И еще такого говнаролла штук 10
text2.text = money
end
local function flapBird_bonus (event)
if(event.phase == "began") then
if(money >= bonus_money_buy) then
money = money - bonus_money_buy
bonus_money_buy = bonus_money_buy * 3
bonus_money_lvl = bonus_money_lvl + 1
end
text2.text = money
text8.text = bonus_money_buy
end
end
local function onUpdate (args)
if(auto_money > 40) then
auto_money = 0
end
---------levels
if(auto_money_lvl == 1) then
if(auto_money == 40) then
money = money + 1
text2.text = money
end
end
---------levels end и еще такого говна штук 10
auto_money = auto_money + 1
end
local function load_settings(fileName)
local path = system.pathForFile(fileName, system.ResourceDirectory)
local contents = ""
local myTable = {}
local file = io.open(path, "r")
if(file) then
contents = file:read("*a")
myTable = json.decode(contents)
io.close(file)
return myTable
end
return nil
end
local settings = loadSettings("settings.json")
if(settings) then
money = settings.money
auto_money = settings.auto_money
auto_money_buy = settings.auto_money_buy
auto_money_lvl = settings.auto_money_lvl
bonus_money_lvl = settings.bonus_money_lvl
bonus_money_buy = settings.bonus_money_buy
end
button:addEventListener("touch", flapBird)
button_auto:addEventListener("touch", flapBird_auto)
button_bonus:addEventListener("touch", flapBird_bonus)
Runtime:addEventListener("enterFrame", onUpdate)
Гейдев.
Метатабличный / Говнокод #25853
0
- 1
Ня, пока.
Пароль: 123456654321123456
Метатабличный / Говнокод #25014
0
- 1
- 2
_G = setmetatable(_G, {__newindex = function(t,k,v) t[k] = "sG_nil" end})
pitux=1
чо поцоны, изи рекурсия.
Метатабличный / Говнокод #24827
0
- 1
print(gnil==ne_gnil) - - true
>:U
Метатабличный / Говнокод #24804
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
--Запрос в яндекс за спичером
function thstart(text)
local th = [[
love.filesystem.remove("tmp.ogg");
local str = ...
local encodeURI = function(str)
if (str) then
str = string.gsub (str, "\n", "\r\n")
str = string.gsub (str, "([^%w ])",
function (c) return string.format ("%%%02X", string.byte(c)) end)
str = string.gsub (str, " ", "+")
end
return str
end
str = encodeURI(str)
local http = require("socket.http");
body = http.request("https://tts.voicetech.yandex.net/generate?text="..str.."&format=mp3&lang=ru-RU&speaker=kolya&emotion=evil&key=069b6659-984b-4c5f-880e-aaedcfd84102&speed=0.8")
if body then
love.filesystem.write("tmp.mp3",body)
love.thread.getChannel('im'):push("tmp.mp3")
else
love.thread.getChannel('im'):push("err")
end
--love.thread.getChannel('im'):push("err")
]]
tred = nil
tred = love.thread.newThread(th);
tred:start(text);
end
function thpop()
local info = love.thread.getChannel( 'im' ):pop()
if info then
if info == "err" then
return "err"
else
return info
end
end
return nil
end
Метатабличный / Говнокод #24797
0
- 1
return x > 0 and true or false
Метатабличный / Говнокод #24762
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 1"), inputs.input1, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 2"), inputs.input2, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 3"), inputs.input3, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 4"), inputs.input4, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 5"), inputs.input5, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 6"), inputs.input6, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 7"), inputs.input7, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 8"), inputs.input8, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 9"), inputs.input9, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 10"), inputs.input10, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 11"), inputs.input11, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 12"), inputs.input12, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 13"), inputs.input13, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 14"), inputs.input14, 0, -1)
imgui.InputInt(u8("Напиши сюда модель объекта которого ты хочешь найти -- 15"), inputs.input15, 0, -1)
зачем цикл если есть ctrl+c и ctrl+v
Метатабличный / Говнокод #24660
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
return coroutine.create(function(x)
while true do
socket.sleep(1);
collectgarbage()
coroutine.yield()
end
end)
Выделил сборщик мусора в отдельный поток, и чтоб он вечно собирал за мной всякую срань, но раз в секунду.
Ожидание: Поток спит в течении 1 секунды.
Реальность: Вся программа спит в течении 1 секунды.
Метатабличный / Говнокод #24619
0
- 1
Давайте ругать torch7
Метатабличный / Говнокод #24534
0
- 1
https://pikabu.ru/story/moy_kuzen_byil_gospitalizirovan_posle_togo_kak_zasunul_sebe_v_anus_28_malenkikh_loshadok_6045256
Метатабличный / Говнокод #24525
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
-- пофикшу позже, юникод неработает. Почему? ХЗ. КОИ-8 навсегда. Armat.
function tmp (...)
...
end
-- я ХЗ на кой тут это надо, но без этой ереси все падает к del . А логи можно и почистить руками. David.
callerr (...)
WTF = GetScriptPosX(ScriptWay, ObrStroka, FlagZalypyByka)
-- Да, без флага никак. То есть совсем. И что он делает мы не знаем, возвращает nil. Но без него nil идет уже в основу. И как эта магия вызова сОтоны работает мы тоже ХЗ. Я не нашел даже где он выставляется - то ли в недрах функции, то ли вообще из двигла выдергивается, там, del, МАГИЯ происходит. David.
...
-- Я без понятия почему, но в двигле этих гомоdel значения XYZ мыши инвертированы. Кроме того, граничные значения опять таки инвертируются, так что далее - такой вот трэш. BK4Ever. И да, del v0.15.2 - ну просто полный del, баг на баге.
WTF4 = WTF4 * -1
if WTF4 == 128 then
WTF4 = 127
elseif WTF4 == -128 then
WTF4 = -127
elseif WTF4 > 128 or WTF4 < -128
callerr(...)
WTF4 = 0
end
SetScriptPos(X, WTF4, dec)
-- Почему везде DEC? Потому, что на дробных в одних местах надо точку, в других - запятую. В падлу, проще округлить. David.
Наш старый обработчик скриптового языка на Lua, аргументы частично удалены для сокращения объема*и потому, что стыдно:-) Сейчас пересмотрел и понял, что некоторые фрагменты определенно заслуживают вклада сюда. И ради б-га не спрашивайте, как это работало - сами по прошествии пяти(вроде) лет без понятия.
Метатабличный / Говнокод #24440
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
c:\Program Files (x86)\Lua\5.1>lua.exe c:\temp\1.lua
0.0012512588885159
c:\Program Files (x86)\Lua\5.1>lua.exe c:\temp\1.lua
0.0012512588885159
c:\Program Files (x86)\Lua\5.1>lua.exe c:\temp\1.lua
0.0012512588885159
c:\Program Files (x86)\Lua\5.1>lua.exe c:\temp\1.lua
0.0012512588885159
c:\Program Files (x86)\Lua\5.1>type c:\temp\1.lua
print(math.random() )
Луа под виндой как-то отчаянно сосет хуй не умея настоящие random из Windows Crypto API.
В результате вызов 150 раз программы дает один и тот же random. Его
конечно можно math.randomseed(os.time()), но то так, бо time это даже не
милисекунды а сеунды.
Забавно что под никсами все зробит как треьба
:1$ lua51 1.lua
0.31260803123592
:2$ lua51 1.lua
0.13656691980388
:3$ lua51 1.lua
0.56430453367732думаю оно читает /dev/random
Золотой хуй, что это такое? Или Сёма прав и прыщелуа не умеет в winapi?
Метатабличный / Говнокод #24325
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
_G = setmetatable(_G,{__index = function() return setmetatable({},{__index = _G}) end})
print(allah,_G) --Разные таблы, при этом аллах даже никак не объявлен
anus.n = 10 --Это будет табла и anus.n будет таблой
anus = {n=10} --Это будет хорошо и anus.n будет 10
HUYZOLOTOY.table.insert(anus,10) --Нормас работает
print(anus.opa) --А это не табла а просто nil
for k,v in uier8u43uirhn_________.pairs(_G) do
hjashsnasmm.print(k,v) --А где Allah и все остальное?
end
_G = setmetatable(_G,{__index = function() return setmetatable({},{__index = _G}) end})
Сколько скриптов сломает проверку на nil?
Метатабличный / Говнокод #24087
0
- 1
return{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
Метатабличный / Говнокод #24068
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
return{
[1] = 100500,
[2] = 10,
x = {
[1] = "ss"
,
[2] = {
[1] = {
[1] = {
[1] = {
[1] = {
}
,
}
,
}
,
}
,
}
,
}
,
}
Орфография сохранена, это моя старая сериализация. Ничего особенного, но когда сериализуем огромное количество таблиц с 100550 вложений, то внешний вид превращается хлеще брайнфака
Метатабличный / Говнокод #24031
0
- 1
- 2
- 3
- 4
local buff = ""
for line in io.lines() do
buff = buff .. line .. "\n"
end
Несмотря на его безобидный вид, этот код может сильно ударить по быстродействию для больших файлов:
например, чтение файла размером 1 Мб занимает 1,5 минуты
Метатабличный / Говнокод #24010
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
if(SERVER)then
util.AddNetworkString("gay_seks")
util.AddNetworkString("natural_seks")
util.AddNetworkString("daite_exp")
AddCSLuaFile("")
local autismo_rangs = { "Рядовой",
"Ефрейтор",
"Сержант",
"Старшина",
"Прапорщик",
"Лейтенант",
"Капитан",
"Майор",
"Подполковник",
"Полковник",
"Генерал",
"Маршал",
"nope" }
local function ebat( ply )
ply:SetNWString("xp_nado",tostring(ply:GetPData("xp_nado",50)))
ply:SetNWString("xp_xp",tostring(ply:GetPData("xp_xp",0)))
ply:SetNWString("xp_rang",autismo_rangs[tonumber(ply:GetPData("xp_rang",1))])
end
local function lvlup( ply )
if(tonumber(ply:GetPData("xp_xp",0)) > tonumber(ply:GetPData("xp_nado",50)))then
ply:SetPData("xp_nado",ply:GetPData("xp_nado",50)*2)
ply:SetPData("xp_xp",0)
ply:SetPData("xp_rang",ply:GetPData("xp_rang",1)+1)
ebat(ply)
net.Start("natural_seks")
net.Send(ply)
else
ebat(ply)
end
end
net.Receive("daite_exp",function(_,ply)
ply:SetPData("xp_xp",ply:GetPData("xp_xp",0)+5)
net.Start("gay_seks")
net.WriteString("+5")
net.Send(ply)
lvlup( ply )
end)
hook.Add("PlayerDeath","seks_s_nikitoi",function( victim, inflictor, attacker )
if ( victim != attacker ) then
attacker:SetPData("xp_xp",attacker:GetPData("xp_xp",0)+1)
lvlup(attacker)
net.Start("gay_seks")
net.WriteString("+1")
net.Send(attacker)
end
end)
hook.Add( "PlayerInitialSpawn", "sex_s_azisom", ebat )
else
surface.CreateFont( "motd_font", { font = "Arial", extended = true, size = 20, weight = 500, blursize = 0, scanlines = 0, antialias = true, underline = false, italic = false, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = true, } )
local function Sex(str)
print(str)
if(IsValid(Sexmenu))then
Sexmenu:Remove()
hook.Remove( "HUDPaint", "4CB_2")
end
hook.Add( "HUDPaint", "4CB_2", function()
draw.Text( { text = str, pos = { ScrW()/2-100, 60 }, font = "motd_font" }) end )
Sexmenu = vgui.Create( "DFrame" )
Sexmenu:SetSize( 400, 40 )
Sexmenu:SetPos(ScrW()/2-200,5)
Sexmenu:SetTitle( "" )
Sexmenu:ShowCloseButton(false)
Sexmenu:SetDraggable( false )
Sexmenu.cal = 255
Sexmenu.Paint = function(s,w,h)
draw.RoundedBox( 10, 0, 0, w, h, Color(0,0,0,Sexmenu.cal) )
if(Sexmenu.cal > 150)then
Sexmenu.cal = Sexmenu.cal-1
else
Sexmenu:Remove()
hook.Remove( "HUDPaint", "4CB_2")
end
draw.RoundedBox( 10, 20, 10, w-40, h-20, Color(100,100,100,Sexmenu.cal) )
draw.RoundedBox( 10, 20, 10, tonumber(LocalPlayer():GetNWString("xp_xp",0))*(360/tonumber(LocalPlayer():GetNWString("xp_nado"))), h-20, Color(100,100,255,Sexmenu.cal) )
draw.RoundedBox( 10, 20+(tonumber(LocalPlayer():GetNWString("xp_xp",0))*(360/tonumber(LocalPlayer():GetNWString("xp_nado"))))-10, 10, 10, h-20, Color(150,150,255,Sexmenu.cal) )
end
end
hook.Add( "HUDPaint", "4CB", function()
draw.Text( { text = "Ты : "..LocalPlayer():GetNWString("xp_rang","gay_hacker")..", до следующего ранга: "..tonumber(LocalPlayer():GetNWString("xp_nado",50))-tonumber(LocalPlayer():GetNWString("xp_xp",0)).." XP", pos = { 10, 10 }, font = "motd_font" })
end )
net.Receive("gay_seks",function() Sex(net.ReadString())
end)
net.Receive("natural_seks",function()
RunConsoleCommand("say","Ура! Я теперь - "..LocalPlayer():GetNWString("xp_rang","gay_hacker")) sound.PlayURL ( "http://prayingforpapers.com/download/Kaihgd_F10kUJ8Hy5ip-fu9FajZ271b4nbYu_Mszc6nPJ2a2HmS-vaFnyqjFspFlTy9YCBzh-4TD7k-JKQz9Zb4RZvHJQUI4fPzxcd2aD6c/%D0%9B%D0%B2%D0%BB+%D0%B0%D0%BF+%D0%BE%D1%83%D1%83+%D0%BC%D0%B0%D0%B9+%D0%BB%D0%B0%D1%84+%D0%B7%D0%B2%D1%83%D0%BA(prayingforpapers.com).mp3", "mono", function( sinok ) sinok:Play() end ) end) local function DAIMOEGOMNO() net.Start("daite_exp") net.SendToServer() timer.Simple(900,function()
DAIMOEGOMNO()
end)
end
timer.Simple(900,function() DAIMOEGOMNO() end)
end
[Garry's Mod Lua]
Код нужен для выдачи рангов игрокам.
Нету табуляций.
Метатабличный / Говнокод #23614
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
local lv = {"sdds"}
lv.act = function(foo)
foo(lv)
end
function start()
local x = function(self)
print(self[1])
end
lv.act(x)
end
start()
Такой значит, насоздаешь одинаковых шаблоных хуйн, а потом по какой-то
причине одна из 82837273723 хуйн должна быть уникальна какой-то
неведомой хуйней и приходится в (шаблоне, но в луа нет шаблонов!)
таблице прописывать половой акт самим с собой, чтоб он смог мутировать в
другую отличную от других неведомых хуй. Например стать бабочкой, но
тогда придется в единной функции хуярить всю бабочку, ну можно много
функций! Тем не менее оригинальная неведомая хуйня не пострадает.
О здаровка
Метатабличный / Говнокод #23489
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
for i=1,1000 do
str = string.format("xyi%i", i)
f = io.open(str, "w")
f:write("я вирус! приветикиии")
f:flush()
f:close()
end
оцениваем по 1000 бальной шкале плиз!
Метатабличный / Говнокод #21783
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
elseif self.text == "> Начать заного! ЙАР!" then
room = 0
Doverie = 0
dublons = 10
Randomquest = 0
smena = 0
day = 0
rom = 0
fat = 30
sutki = "Утро"
modify.metka = 1
LperkBOO[1] = false
elseif self.text == "> Выход из квеста" then
love.event.quit()
elseif self.text == "> Пройти в каюты" or self.text == "> Ой! Что-то не хочется!" then
room = 13
smena = smena + plussmena
Randomquest = math.random(0,1000)
elseif self.text == "> Присоеденится к игре" then
room = 14
smena = smena + plussmena
Randomquest = math.random(0,1000)
elseif self.text == "> Начать играть!" then
room = 17
smena = smena + plussmena
local sl = {". Он настроен решительно, стукнул своим дублоном по столу. Усердно потряс в кружке кости и бросил их на стол.",". Он не спеша положил свой дублон на стол, слегка потряся в кружке кости кинул их на стол.",". Он не долго думая положил дублон на стол, помешав в крушке кости и бросил их на стол.",". Он Неуверено положив дублон на стол, помешал кости и бросил их на стол." }
slu = math.random(1,4)
if slu == 1 then
slu = sl[1]
elseif slu == 2 then
slu = sl[2]
elseif slu == 3 then
slu = sl[3]
elseif slu == 4 then
slu = sl[4]
end
kubiki = math.random(2,12)
name = math.random(1,8)
if name == 1 then
name = names[1]
elseif name == 2 then
name = names[2]
elseif name == 3 then
name = names[3]
elseif name == 4 then
name = names[4]
elseif name == 5 then
name = names[5]
elseif name == 6 then
name = names[6]
elseif name == 7 then
name = names[7]
elseif name == 8 then
name = names[8]
end
moikubiki = math.random(2,12)
elseif self.text == "> Положить дублон и бросить кости!" then
smena = smena + plussmena
room = 18
if kubiki > moikubiki then
text = "Потреся кости в кружке вы бросили их настол и задержали дыхание, но увы у вас: "..moikubiki.." Это меньше чем у сопернка, его очки: "..kubiki.."\n\nК сожелению вы проиграли 1 дублон!"
textbutton[1] = "> Черт тебя бери!"
dublons = dublons - 1
elseif kubiki < moikubiki then
text = "Потреся кости в кружке вы бросили их настол и задержали дыхание, у вас: "..moikubiki.." Это больше чем у сопернка, его очки: "..kubiki.."\n\nПоздравляю, вы выиграли 1 дублон!"
textbutton[1] = "> Забрать выигрышь"
dublons = dublons + 1
else
text = "Потреся кости в кружке вы бросили их настол и задержали дыхание, но увы у вас: "..moikubiki.." Это столько же сколько и у сопернка, его очки: "..kubiki.."\n\nНичья!"
textbutton[1] = "> Ну ничего!"
end
elseif self.text == "> Черт тебя бери!" then
smena = smena + plussmena
room = 14
elseif self.text == "> Ну ничего!" then
smena = smena + plussmena
room = 14
elseif self.text == "> Забрать выигрышь" then
smena = smena + plussmena
room = 14
elseif self.text == "> Сжульничать. Шанс: "..50/modify.metka.."%" then
smena = smena + plussmena
Ahtipodliyzhulik = math.random(0,1*modify.metka)
if Ahtipodliyzhulik == 1 then
moikubiki = math.random(10,12)
text = text.."\n\n Вам удалось сжульничать! Предпологаемые числа от 10 до 12"
room = 18
else
Doverie = Doverie -50
room = "K odmone"
end
Когда-то давно, я так писал.
и там таких elseif на тысячу строк, это должен был квест.
Метатабличный / Говнокод #21777
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
local player = script.Parent.Parent
local character = player.Character.Humanoid
local settings = game.ServerStorage.AntiCheatConfig
while true do
if player.CameraMaxZoomDistance ~= settings.CameraMaxZoomDistance.Value then player.CameraMaxZoomDistance = settings.CameraMaxZoomDistance.Value end
if player.CameraMinZoomDistance ~= settings.CameraMinZoomDistance.Value then player.CameraMinZoomDistance = settings.CameraMinZoomDistance.Value end
if player.CameraMode ~= 0 then player.CameraMode = 0 end
if player.DevCameraOcclusionMode ~= 0 then player.DevCameraOcclusionMode =0 end
if player.DevComputerCameraMode ~= 0 then player.DevComputerCameraMode = 0 end
if player.DevTouchCameraMode ~= 0 then player.DevTouchCameraMode = 0 end
if player.CanLoadCharacterAppearance ~= true then player.CanLoadCharacterAppearance = true end
if player.DevComputerMovementMode ~= 0 then player.DevComputerMovementMode = 0 end
if player.DevTouchMovementMode ~= 0 then player.DevTouchMovementMode = 0 end
if character.MaxHealth > settings.MaxHealth.Value then character.MaxHealth = settings.MaxHealth.Value end
if character.Health > character.MaxHealth then character.Health = character.MaxHealth end
if character.WalkSpeed > settings.WalkSpeed.Value then character.WalkSpeed = settings.WalkSpeed.Value end
if character.JumpPower > settings.JumpPower.Value then character.JumpPower = settings.JumpPower.Value end
if character.HipHeight > 1 then character.HipHeight = 1 end
wait(.1) -- We don't need crash
end
Nuff said.
Метатабличный / Говнокод #21764
0
- 1
if not ok then return end
Minecraft splash
Метатабличный / Говнокод #21705
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
{ Delphi compatible }
{$IFNDEF PtrInt} type PtrInt = ^Integer; {$ENDIF}
{$IFNDEF PPointer} type PPointer = ^Pointer; {$ENDIF}
{$IFNDEF PPChar} type PPChar = ^PChar; {$ENDIF}
var
ls_lib: array[1..3] of luaL_reg =
(
(name: 'MultAllNumbers'; func: forLua_MultAllNumbers),
(name: 'GetHostAppPath'; func: forLua_GetHostAppPath),
(name: nil; func: nil)
);
function luaopen_SimpleDelphiLua(L: Plua_State): Integer; cdecl;
begin
luaL_openlib(L, PChar('SimpleDelphiLua'), @ls_lib, 0);
lua_pop(L, 1);
Result := 0;
end;
https://quik2dde.ru/viewtopic.php?id=40
Чел пишет на луе, и юзает дельфийские либы.
Обратите внимание, как он декларирует типы.
Метатабличный / Говнокод #21698
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
-- Searching for localization files
local lang_id = System.getLanguage()
local localization
if lang_id == 0 then
localization = chdir().."../CHMM Localization/japanese.txt"
elseif lang_id == 1 then
localization = chdir().."../CHMM Localization/english.txt"
elseif lang_id == 2 then
localization = chdir().."../CHMM Localization/french.txt"
elseif lang_id == 3 then
localization = chdir().."../CHMM Localization/german.txt"
elseif lang_id == 4 then
localization = chdir().."../CHMM Localization/italian.txt"
elseif lang_id == 5 then
localization = chdir().."../CHMM Localization/spanish.txt"
elseif lang_id == 6 then
localization = chdir().."../CHMM Localization/simplified chinese.txt"
elseif lang_id == 7 then
localization = chdir().."../CHMM Localization/korean.txt"
elseif lang_id == 8 then
localization = chdir().."../CHMM Localization/dutch.txt"
elseif lang_id == 9 then
localization = chdir().."../CHMM Localization/portuguese.txt"
elseif lang_id == 10 then
localization = chdir().."../CHMM Localization/russian.txt"
else
localization = chdir().."../CHMM Localization/traditional chinese.txt"
end
if not doesFileExist(localization) then
localization = "romfs:/english.txt"
end
dofile(localization)
(c) https://github.com/Rinnegatamante/CHMM2/blob/master/source/boot.lua
Метатабличный / Говнокод #21601
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
if closedk>0 then
for k=1,closedk do
if closedlist[k].x==curbase.x+1 and closedlist[k].y==curbase.y then
rightOK=false
end
if closedlist[k].x==curbase.x-1 and closedlist[k].y==curbase.y then
leftOK=false
end
if closedlist[k].x==curbase.x and closedlist[k].y==curbase.y+1 then
downOK=false
end
if closedlist[k].x==curbase.x and closedlist[k].y==curbase.y-1 then
upOK=false
end
end
end
-- Check if next points are on the map and within moving distance
if curbase.x+1>xsize then
rightOK=false
end
if curbase.x-1<1 then
leftOK=false
end
if curbase.y+1>ysize then
downOK=false
end
if curbase.y-1<1 then
upOK=false
end
-- If it IS on the map, check map for obstacles
--(Lua returns an error if you try to access a table position that doesn't exist, so you can't combine it with above)
if curbase.x+1<=xsize and mapmat[curbase.y][curbase.x+1]~=0 then
rightOK=false
end
if curbase.x-1>=1 and mapmat[curbase.y][curbase.x-1]~=0 then
leftOK=false
end
if curbase.y+1<=ysize and mapmat[curbase.y+1][curbase.x]~=0 then
downOK=false
end
if curbase.y-1>=1 and mapmat[curbase.y-1][curbase.x]~=0 then
upOK=false
end
Кусок кода A* какого-то чувака, который не знает что такое elseif
К тому же с 19 по 30 строки можно выпилить, просто curbase.x+1<=xsize
подобных условий заменить на проверку на существование нужного элемента
таблицы.
Сам код тут: https://github.com/philnelson/A-Star-Pathfinding-For-Lua/blob/master/A-star%20algorithm%20release.lua
Метатабличный / Говнокод #21571
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
function True()
do
do
do
do
return true
end
return true
end
do do do do do do return true
end end end end
return true
end
do do return end
end
return true
end
return true
end
do
return true
end
end
return true
end
Метатабличный / Говнокод #21282
0
- 1
А не напиться ли нам "солнцедару"?
Забухать шоли.
Метатабличный / Говнокод #21281
0
- 1
Давайте в жопу ебаться.
Метатабличный / Говнокод #21275
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
local r = LocalPlayer():GetRole()
for _, p in pairs(player.GetAll()) do
local cramprib = p:GetRole()
if r != ROLE_TRAITOR then
if IsValid(p) and cramprib == ROLE_DETECTIVE and p != LocalPlayer() then
dpick:AddChoice(p:Nick(), p:UniqueID())
end
elseif r == ROLE_TRAITOR then
if IsValid(p) and cramprib != ROLE_INNOCENT and p != LocalPlayer() then
dpick:AddChoice(p:Nick(), p:UniqueID())
end
end
end
a != a
Метатабличный / Говнокод #21175
0
- 1
- 2
- 3
- 4
- 5
- 6
Луашники на все смотрят как на таблицу
Человека можно разделить на таблицу с таблицами функции с таблицами в таблице функций
Вот ты, да ты, я вижу в тебе сущность в виде таблицы, таблица.
Человек = {}
Кстати, когда твое время истечет таблица, то table.remove(self) и твоя таблица исчезнет с лица таблицы земля
Метатабличный / Говнокод #21048
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
lit = {"aeoiyu","qwrtpsdfghjklzxcvbnm"}
function strgen()
local stor = ""
while true do
local r = {math.random(1,#lit[1]),math.random(1,#lit[2])}
local s = {lit[1]:sub(r[1],r[1]),lit[2]:sub(r[2],r[2])}
r2 = math.random(1,4)
if r2 == 1 then
stor = stor..s[1]..s[2]
else
stor = stor..s[2]..s[1]
end
if math.random(1, 10-#stor) == 1 then
break
end
end
return stor
end
Назову я его генератор для названий заклинаний
Метатабличный / Говнокод #20496
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
people = {}
function people:cr(age,id,fami)
local t = {}
t.age = age or {0,0,0} --лет, месяцев, дней
t.id = id
t.mid = id
t.gen = math.random(1,2)
sch[1][t.gen] = sch[1][t.gen]+1
t.name = name[t.gen][math.random(1,#name[t.gen])]
t.fam = name[1][math.random(1,#name[t.gen])]..fam[t.gen]
if fami then
t.fam = fami..fam[t.gen]
end
t.b = false; t.zh = false; t.sv = {"",""}
t.tirod = 0; t.srname = ""
return setmetatable(t,{__index = self})
end
function people:life()
self.age[3] = self.age[3] + 1
if self.age[3] == 30 then
self.age[2] = self.age[2] + 1
self.age[3] = 0
end
if self.age[2] == 12 then
self.age[2] = 0
self.age[1] = self.age[1] + 1
end
if self.age[1] >= 16 then
if self.gen == 2 then
if self.zh then
if self.tirod == 0 then
local r = math.random(1,20)
if r == 1 then
self.tirod = 1
end
end
else
if not self.zhid then
self.zhid = #sch[2]+1
--print(self.zhid)
sch[2][#sch[2]+1] = self.id
end
end
if self.tirod > 0 then
local r = math.random(266,294)
local ploho = math.random(1,10000)
self.tirod = self.tirod + 1
if ploho == 1 then
self.tirod = 0
end
if self.tirod >= r then
local _ = #pl+1
local name = self.sv[1]
if self.srname then
name = self.srname
self.srname = nil
end
pl[_] = people:cr(nil,_,name)
self.tirod = 0
end
end
else
if not self.zh then
local r = math.random(1,200)
if r == 1 then
local l = math.random(1,#sch[2])
self.mid = sch[2][l]
print(self.mid,l)
local n,f = pl[self.mid]:svadba(self.name,self.fam,self.id)
self:svadba(n,f,id)
table.remove(sch[2],l)
end
end
end
end
self.rkill = math.random(1, 10000)
if self.rkill == 1 then
sch[1][self.gen] = sch[1][self.gen]-1
if self.gen = 2 and not self.zh then
pl[self.id] = nil
end
end
end
function people:svadba(n,f,id)
self.sv = {n,f}
self.mid = id
self.zh = true
return self.name, self.fam
end
local tex = {" Женат на "," Замужем за "}
function people:dr(x,y)
gr.print(self.name.." "..self.fam.." "..self.age[1].." "..self.age[2].." "..self.age[3].." беременность: "..self.tirod..tex[self.gen]..self.sv[1].." "..self.sv[2],x,y)
end
Багованая жизнь
Метатабличный / Говнокод #20421
0
- 1
Где мой lua?
Метатабличный / Говнокод #20416
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
math.randomseed(os.time())
local a = {}
a[#a+1] = function() --create
local t = {}
t[#a+1] = math.random(1,100)
t[#a+2] = 'хуй'
return setmetatable(t,{__index = a})
end
a[#a+1] = function() --empty function
end
local t = a[1]()
for k,v in ipairs(t) do
print(k,v) --показывает все элементы таблицы как положено
end
print(#t) --0
print(t[4]) --хуй
Загадка: почему длина таблицы t = 0?
ps. # - это оператор возращает длину
Метатабличный / Говнокод #20363
0
- 1
lua socet
допустил такую ошибку когда искал либу socket'а
Метатабличный / Говнокод #20213
0
- 1
print(nil or true and nil or false or x and true and false or y)
Метатабличный / Говнокод #20064
0
- 1
- 2
- 3
- 4
govno = "100"
kod = "500"
_G["govno".."kod"] = "говно"
print(govnokod) --вывод говно
Метатабличный / Говнокод #20043
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
local p = 14 --puxel
local font = love.graphics.newFont("LiberationMono-Regular.ttf",p)
love.graphics.setFont(font)
local text = "ASSHOLEGHOSTWISHMASTER"
love.filesystem.setIdentity(text)
local img = love.image.newImageData("jpg/Gutalax - Asshole Ghost Wishmaster (official)(1) 0001.jpg")
local w, h = img:getDimensions( )
text = text:rep(math.ceil(w/text:len()))
local t = love.filesystem.getDirectoryItems(text)
t = #t
--print(t)
cdr = 1200 --frame
t = cdr-1 --one frame
--love.graphics.setBackgroundColor(0,0,0)
for i=t+1, cdr do
local n = string.format("%04d",i)
img = love.image.newImageData("jpg/Gutalax - Asshole Ghost Wishmaster (official)(1) "..n..".jpg")
local c = love.graphics.newCanvas(w*(p-1),h*(p-1))
love.graphics.setCanvas(c)
love.graphics.setColor(0,0,0)
love.graphics.rectangle("fill", 0, 0, w*(p-1), h*(p-1) )
for x=0, w-1 do
for y=0, h-1 do
local r,g,b = img:getPixel(x,y)
love.graphics.setColor(r,g,b)
love.graphics.print(text:sub(x,x),(x-1)*(p-1),(y-1)*(p-1))
end
end
print("procesing "..i)
local screen = c:newImageData()
screen:encode('png',i..'.png')
collectgarbage()
end
love.graphics.setCanvas()
На скриптах такое лучше не реализовывать, очень медлено...
Выхлоп: https://yadi.sk/i/tI8Wi2ukrpY8i
Метатабличный / Говнокод #20029
0
- 1
- 2
- 3
xyu = function() return pairs({0}) end
for no_money, CBucTHu in xyu() do end
my english very ploh
Метатабличный / Говнокод #20012
0
- 1
- 2
- 3
- 4
govno = {10}
a = {5}
setmetatable(a, {__add = function(x,y) return x[1] * y[1] end})
print(a+govno) -- 50
плохо что работает только с таблицами
Метатабличный / Говнокод #20005
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
do
local gull, coc --гуля? сосок?
local tbl = {}
math.randomseed(os.time()*os.clock()/math.floor(os.clock()))
print("Введите число кокосов")
local val = io.read("*number")
local sum_wei = 0
local sg = 0
for i=1, val do
coc = math.random(1500,2500)
print("Кокос № "..i.."весит: "..coc.." гр.")
sum_wei = sum_wei + coc
end
while true do
gull = math.random(17,19)
--print("ласточка №"..i.."весит: "..gull)
table.insert(tbl,0)
sg = sg + gull/2
if sg > sum_wei then break end
end
local val_s = #tbl
local t = "кокос"
if val < 5 and val > 1 then
t = t.."а"
elseif val > 4 then
t = t.."ов"
end
local c = "ласточ"
if val_s < 5 and val_s > 1 then
c = c.."и"
elseif val_s > 4 then
c = c.."ек"
end
print("Вам "..val_s.." "..c.." принесли "..val.." "..t.."\n Общая масса ласточек: "..sg.."\n Общая масса кокосов: "..sum_wei)
end
Подсчет сколько нужно ласточек для n число кокосов
Привет из "Монти Пайтон и Священый Грааль"
Хотите подсчитать в онлайн интерпретаторах? на 6 строчке замените io.read("*number") на нужное вам число кокосов. например так
local val = 10
Нет это не лаба, хотя и выглядит так.
Метатабличный / Говнокод #19976
0
- 1
- 2
- 3
a = nil
--или так
a = {nil}
Встречал несколько раз, не понимаю зачем эдакое делать
Метатабличный / Говнокод #19957
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
do
local name = {"Маша ","Алиса ","Анджела ","Настя ","Петровна ","Василиса ","Олег "}
local beauty = {"Супер ","Так себе ","Очень даже ничего ","Ужас! "}
local len_n, len_b = #name, #beauty
math.randomseed(os.time())
local kurwa = {}
function kurwa:cr()
local t = {}
t.money = math.random(1000,100000)
t.name = name[math.random(1,len_n)]
t.b = beauty[math.random(1,len_b)]
return setmetatable(t, {__index = self})
end
function kurwa:say()
local x
if self.name ~= name[7] then
x = " она "
else
x = " он "
end
print("Имя: "..self.name.."Оплата труда: "..self.money..x..self.b)
end
for i=1, 5 do --заказываем 5 курв
table.insert(kurwa, kurwa:cr())
end
for cv,kw in ipairs(kurwa) do
print("№"..cv)
if type(kw) == "table" then
kw:say()
end
end
end
Симулятор Случайных шлюх
Метатабличный / Говнокод #19934
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
строка = {гони_длину = string.len, подстановка = string.gsub, маленькие_буквы = string.lower, большие_буквы = string.upper, гони_кусок = string.sub}
ос = {время = os.time, таймер = os.clock}
таблица = {внедрить = table.insert, удалить = table.remove, сортировка = table.sort, перебери = table.foreach}
матан = {модуль = math.abs, огругление_верх = math.ceil, огругление_низ = math.floor, случайно = math.random, ключ_случайности = math.randomseed}
ввод_вывод = {читать = io.read, записать = io.write, открыть = io.open}
тип = type
вернуть_пару = ipairs
незнаю_как_точно_это_описать = pairs
печатать = print
времечко = ос.таймер()
матан.ключ_случайности(ос.время())
тбл = {}
таблица.внедрить(тбл,{"petux","kurica","arbalet","turnik","ne sluzhil - ne muzhik"})
таблица.перебери(тбл[1], function(k,v) if v == "arbalet" then печатать(строка.гони_длину(v)); таблица.удалить(тбл[1], k) end end)
печатать("---------------------------------------------")
таблица.перебери(тбл[1], print)
печатать("operacia viponena za "..времечко.."sek\n"..строка.большие_буквы("cho tak medleno suka").."\nSluchaynoe chislo ot 1 do 1000: "..матан.случайно(1,1000))
кажись в онлайн интерпретатор и выше версии lua 5.1 это не работает!
но на двиге love2d работает
Метатабличный / Говнокод #19875
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
a = {}
a[{}] = 100500
local store
for i, k in pairs(a) do
print(i,k) --table, 100500
store = i
end
print(a[{}]) --nil
print(a[store]) --100500
Метатабличный / Говнокод #19872
0
- 1
math.randomseed(math.random(1,100))
Метатабличный / Говнокод #19860
0
- 1
- 2
- 3
- 4
- 5
a = {}
table.insert(a,a)
a[1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][1][21312] = 5
a[1][1][1][1][1][1][1][1][1][1] = 1
print(a[1], a[21312]) -- Вывод: 1, 5
Метатабличный / Говнокод #19857
0
- 1
- 2
a = {try = function() if a then print("\"a\" BE!") else print("\"a\" not BE!") end end}
a.try()
Проверка самого себя на существование, а вдруг он чья та иллюзия?!
Метатабличный / Говнокод #19504
0
- 1
- 2
- 3
while false ~= true do
-- some code
end
всегда так пишу бесконечные циклы на Lua, ибо в этом есть некий философский смысл)))
код будет выполняться пока ложь не станет истиной...
Метатабличный / Говнокод #18346
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
local sol_lines = {}
local i = 1; local j = 0;
while (i <= solution:len()) do
local begin_pos = i
while(i <= solution:len() and solution:sub(i, i) ~= '\n') do
i = i + 1
end
if i > solution:len() then
i = solution:len()
end
local cur_line = solution:sub(begin_pos, i)
sol_lines[j] = trim(cur_line)
i = i + 1
j = j + 1
end
Lua
Как я разбивал строку на отдельные линии. Вместо того, чтобы
использовать string.find(s, "\n", i + 1). Так я писал код 0.027397 года
назад назад.
Метатабличный / Говнокод #16820
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
function SAEController:GetPointVariableValue(WayNet,CurPoint)
local waypointVars = {};
for i = 0, WayNet:GetPointsCount() - 1 do
local Link = WayNet:GetPoint(i);
local PlaySound1 = Link:GetVariableValue("PlaySound1");
local PlaySound2 = Link:GetVariableValue("PlaySound2");
local PlaySound3 = Link:GetVariableValue("PlaySound3");
local Effect1 = Link:GetVariableValue("Effect1");
local Effect2 = Link:GetVariableValue("Effect2");
local Effect3 = Link:GetVariableValue("Effect3");
if PlaySound1 and CurPoint == Link then
waypointVars.PlaySound1 = PlaySound1;
end;
if PlaySound2 and CurPoint == Link then
waypointVars.PlaySound2 = PlaySound2;
end;
if PlaySound3 and CurPoint == Link then
waypointVars.PlaySound3 = PlaySound3;
end;
if Effect1 and CurPoint == Link then
waypointVars.Effect1 = Effect1;
end;
if Effect2 and CurPoint == Link then
waypointVars.Effect2 = Effect2;
end;
if Effect3 and CurPoint == Link then
waypointVars.Effect3 = Effect3;
end;
end;
return waypointVars;
end;
Кусок игровой логики на Lua. Функция проверяет значение переменных в текущей точке пути моба.
Мы перебираем все точки пути и сравниваем с текущей точкой моба, но это
не нужно, так как именно текущая точка в функцию и передаётся!
Метатабличный / Говнокод #16047
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
c1 = true
c2 = true
c3 = true
c4 = true
c5 = true
c6 = true
c7 = true
c8 = true
c9 = true
c10 = true
c11 = true
c12 = true
c13 = true
next = true
function goForward()
c1 = c2
c2 = c3
c3 = c4
c4 = c5
c5 = c6
c6 = c7
c7 = c8
c8 = c9
c9 = c10
c10 = c11
c11 = c12
c12 = c13
c13 = next
end
Немножко Lua-кода от геймдизайнера.
Метатабличный / Говнокод #13636
0
- 1
- 2
- 3
if hiGrifters.year > 2014 or hiGrifters.month > 1 or hiGrifters.day == nil then
os.exit(0)
end
Защита вшитая в библиотеку на lua - проверять условия с датами мы не умеем
Метатабличный / Говнокод #13425
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
['run'] = function(num, skipt)
if num > 0 and num <= table.maxn(_G.levels_code.list) then
if tbl_save._.options.tutorial then
if ((_G.levels_code.list[num][2] == 1 and _G.levels_code.list[num][1] == 1) or (_G.levels_code.list[num][2] == 1 and _G.levels_code.list[num][1] == 0)) and not skipt then
game.Mission.instance():runLevel(fld.levelTutorial, 1)
mawidgets._.hud.action.set_lvl(fld.levelTutorial, 1)
mawidgets._.tips_widget.action.set('tutorial')
_G.widget_type = 'tutorial';
mawidgets._.tutorial.texts.tutorial_text:setText("Tutorial1")
elseif ((_G.levels_code.list[num][2] == 2 and _G.levels_code.list[num][1] == 1) or (_G.levels_code.list[num][2] == 5 and _G.levels_code.list[num][1] == 0)) and not skipt then
game.Mission.instance():runLevel(fld.levelTutorial, 2)
mawidgets._.hud.action.set_lvl(fld.levelTutorial, 2)
mawidgets._.tips_widget.action.set('tutorial')
_G.widget_type = 'tutorial';
mawidgets._.tutorial.texts.tutorial_text:setText("Tutorial2")
elseif ((_G.levels_code.list[num][2] == 3 and _G.levels_code.list[num][1] == 1) or (_G.levels_code.list[num][2] == 11 and _G.levels_code.list[num][1] == 0)) and not skipt then
game.Mission.instance():runLevel(fld.levelTutorial, 3)
mawidgets._.hud.action.set_lvl(fld.levelTutorial, 3)
mawidgets._.tips_widget.action.set('tutorial')
_G.widget_type = 'tutorial';
mawidgets._.tutorial.texts.tutorial_text:setText("Tutorial3")
elseif ((_G.levels_code.list[num][2] == 5 and _G.levels_code.list[num][1] == 1) or (_G.levels_code.list[num][2] == 15 and _G.levels_code.list[num][1] == 0)) and not skipt then
game.Mission.instance():runLevel(fld.levelTutorial, 4)
mawidgets._.hud.action.set_lvl(fld.levelTutorial, 4)
mawidgets._.tips_widget.action.set('tutorial')
_G.widget_type = 'tutorial';
mawidgets._.tutorial.texts.tutorial_text:setText("Tutorial4")
elseif ((_G.levels_code.list[num][2] == 6 and _G.levels_code.list[num][1] == 1) or (_G.levels_code.list[num][2] == 16 and _G.levels_code.list[num][1] == 0)) and not skipt then
game.Mission.instance():runLevel(fld.levelTutorial, 5)
mawidgets._.hud.action.set_lvl(fld.levelTutorial, 5)
mawidgets._.tips_widget.action.set('tutorial')
_G.widget_type = 'tutorial';
mawidgets._.tutorial.texts.tutorial_text:setText("Tutorial5")
else
mawidgets._.tips_widget.action.set('clear')
_G.widget_type = 0;
mawidgets._.tutorial.action.hide()
if _G.levels_code.list[num][1] == 2 and tbl_save._.options.tutorial_bonus then
mawidgets._.tutorial.texts.tutorial_text:setText("Tutorial6")
end
game.Mission.instance():runLevel(_G.levels_code.list[num][1], _G.levels_code.list[num][2])
mawidgets._.hud.action.set_lvl(_G.levels_code.list[num][1], _G.levels_code.list[num][2])
end
else
mawidgets._.tips_widget.action.set('clear')
tbl_save._.options.tutorial_bonus = false
data.WriteDataInSlot(tbl_save._)
mawidgets._.tutorial.action.hide()
game.Mission.instance():runLevel(_G.levels_code.list[num][1], _G.levels_code.list[num][2])
mawidgets._.hud.action.set_lvl(_G.levels_code.list[num][1], _G.levels_code.list[num][2])
end
else print('_G.levels_code.run -> bad level num: ', num) end
end;
Игра - головоломка, язык этого гк - Lua, в проекте - ~ 26 000 файлов.
Нет в жизни счастья.
Метатабличный / Говнокод #9627
0
- 1
- 2
- 3
- 4
Splash = playGrayscaleSplashFx
playGrayscaleSplashFx = function()
end
Хороший, годный аналог #define true false.
Обнаружен в Lua-скрипте, автоматически включающемся во все скриптовые контексты (примерный аналог precompiled header).
playGrayscaleSplashFx - функция, экспортируемая в Lua из C++ кода.
Внёс в неё изменения, попытался протестировать результат... долго думал.
Метатабличный / Говнокод #8651
0
- 1
- 2
-- All scripts should begin at line
null, Null, NULL = nil
Lua
Метатабличный / Говнокод #7584
0
- 1
- 2
- 3
- 4
- 5
if ( (world:isSelectionMode() or (world:getEffectSizeIcoLua() == 1) or
(world:getEffectSizeIcoLua() == -1)) and (world:getEffectSizeIcoLua() ~= 2) )
then
...
end
Скрипт на Lua, доставшийся в наследство. Несмотря на непонятное условие, вся грусть в том, что все значения скрипт получает с движка, и что это за значения нет ни одного комента... '-(
Метатабличный / Говнокод #7297
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
function onUpdate(this)
local a;
a = math.floor( math.random() * 1000);
if(a==68)then
playParticleFx(this,"/particles/spider/spider_lift.psysl",10);
--logWarning("spirder1");
end
if(a==35)then
playParticleFx(this,"/particles/spider/spider_lift_1.psysl",10);
--logWarning("spirder2");
end
if(a==73)then
playParticleFx(this,"/particles/spider/spider_lift_2.psysl",10);
--logWarning("spirder3");
end
end;
Выдержка из Lua-скрипта.
Выпускаем побегать декоративного паучка по случайными интервалам времени.
Метатабличный / Говнокод #7195
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
-- async IO operations
-- op1.asyncRun(cb) - execute op1, and call cb(op1_result) after op1 completion
-- op1 * g - new async operation which will execute op1.asyncRun(), then execute g(op1_result).asyncRun() and return op2_result
-- op1 .. op2 - the same, but ignore result of op1. Will execute op1.asyncRun(), then op2.asyncRun() and return op2_result
private.binder = {
__mul =
function(op1, g)
local op = {
asyncRun =
function(cb)
op1.asyncRun(
function(op1_result)
g(op1_result).asyncRun(cb)
end
)
end
}
setmetatable(op, private.binder)
return op
end,
__concat =
function(op1, op2)
return op1 * function(op1_result) return op2 end
end,
__metatable = 1
}
-- примеры использования:
-- (Chatter.IO.Log("tic") .. Chatter.IO.Sleep(1000) .. Chatter.IO.Log("tac") .. Chatter.IO.Sleep(1000) .. Chatter.IO.Log("toe")).asyncRun(function() end)
-- (Chatter.IO.GetTime * Chatter.IO.Log .. Chatter.IO.Sleep(1000) .. Chatter.IO.GetTime * Chatter.IO.Log).asyncRun(function() end)
Lua.
Метатабличный / Говнокод #6809
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
--загрузка шрифта
MyFont = pge.font.load("verdana.ttf",12)
--цвета шрифта
white = pge.gfx.createcolor(255,255,255)
green = pge.gfx.createcolor(0,255,0)
--загрузка графики
A01 = pge.texture.load("pics/A-01.png")
A02 = pge.texture.load("pics/A-02.png")
A03 = pge.texture.load("pics/A-03.png")
A04 = pge.texture.load("pics/A-04.png")
A05 = pge.texture.load("pics/A-05.png")
A06 = pge.texture.load("pics/A-06.png")
A07 = pge.texture.load("pics/A-07.png")
A08 = pge.texture.load("pics/A-08.png")
A09 = pge.texture.load("pics/A-09.png")
A10 = pge.texture.load("pics/A-10.png")
A11 = pge.texture.load("pics/A-11.png")
A12 = pge.texture.load("pics/A-12.png")
A13 = pge.texture.load("pics/A-13.png")
A14 = pge.texture.load("pics/A-14.png")
A15 = pge.texture.load("pics/A-15.png")
A16 = pge.texture.load("pics/A-16.png")
A17 = pge.texture.load("pics/A-17.png")
A18 = pge.texture.load("pics/A-18.png")
A19 = pge.texture.load("pics/A-19.png")
A20 = pge.texture.load("pics/A-20.png")
A21 = pge.texture.load("pics/A-21.png")
A22 = pge.texture.load("pics/A-22.png")
A23 = pge.texture.load("pics/A-23.png")
A24 = pge.texture.load("pics/A-24.png")
--переменная для счётчика
index = 1
while pge.running() do
pge.controls.update()
pge.gfx.startdrawing() -- начало рисования
pge.gfx.clearscreen() -- очистка экрана
if pge.controls.pressed(PGE_CTRL_DOWN) then
index = index+1 -- увеличиваем index на 1
end
A01:activate()
A01:draw(30,25) -- отрисовка первой картинки
-- далее отрисовка последующих картинок в зависимости от значения переменной index
if index==2 then
pge.gfx.clearscreen()
A02:activate()
A02:draw(30,25)
end
if index==3 then
pge.gfx.clearscreen()
A03:activate()
A03:draw(30,25)
end
if index==4 then
pge.gfx.clearscreen()
A04:activate()
A04:draw(30,25)
end
if index==5 then
pge.gfx.clearscreen()
A05:activate()
A05:draw(30,25)
end
if index==6 then
pge.gfx.clearscreen()
A06:activate()
A06:draw(30,25)
end
pge.gfx.enddrawing() -- конец отрисовки
pge.gfx.swapbuffers()
if pge.controls.pressed(PGE_CTRL_START) then
break
end
end
Увидел и не смог не запостить
Lua
Метатабличный / Говнокод #6746
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
require "android"
local inp = android.getInput("Factorial", "Enter number:")
local cur = 0
local sum = 1
repeat
cur = cur + 1
sum = sum * cur
until cur == (inp.result * 1)
android.makeToast("Factorial of " .. inp.result .. " is " .. sum)
Lua. Маленький скриптик "факториал", накиданный на моём Desire Z в SL4A.
Как-то явно не так надо строковые типы к целочисленным приводить...
Метатабличный / Говнокод #6337
0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
function repair_clock_Contact(objGame, mVal, sVal) -- master, slave
-- vsyakie daNNue
local mType = string.sub (tostring (mVal), -1, -1);
local mi, mj = repair_clock_GetElemPos(objGame, mVal);
local sType = string.sub (tostring (sVal), -1, -1);
local si, sj = repair_clock_GetElemPos(objGame, sVal);
--?????NEKYUiNYAvKVADRATE???????
-- if (tonumber (mType) == 2) then -- FOR MEHA TEST
-- local a = 0;
-- end
if (tonumber (mType) == 9) then
mType = 2;
end
--??????????????????????????????
--!!!!!NEKYUiNYA!!!!!
mType = 6 - mType;
sType = 6 - sType;
--!!!!!!!!!!!!!!!!!!
--------------------
..........................
Коменты жгут)))
язык Lua
Метатабличный / Говнокод #4220
0
- 1
- 2
- 3
- 4
- 5
- 6
ga = {} --gay/pure lua style
GA = ga --1337 men style
GlobalAdmin = ga --Java style
GlObAlAdMiN = ga --xxx asked :D
globalAdmin = ga --C style
globaladmin = ga --other plain lua style
Долго не могли решить как назвать глобальную таблицу в lua... лучшего решения не нашли.
Комментарии
Отправить комментарий