mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
[Gates] Remove Rape.
This commit is contained in:
parent
1227e0c04f
commit
3453ee543d
@ -382,35 +382,24 @@ GateActions["Average"] = {
|
||||
inputs = { "A", "B", "C", "D", "E", "F", "G", "H" },
|
||||
compact_inputs = 2,
|
||||
output = function(gate, ...)
|
||||
vals = 0
|
||||
value = 0
|
||||
-- function doavg (argument)
|
||||
-- vals += 1
|
||||
-- value += argument
|
||||
-- end
|
||||
--table.foreach(arg, doavg)
|
||||
local vals = 0
|
||||
local value = 0
|
||||
for k,v in ipairs(arg) do
|
||||
vals = vals + 1
|
||||
value = value + v
|
||||
end
|
||||
return value / vals
|
||||
--Msg("Rape!")
|
||||
--Msg("It was "..value.."!")
|
||||
--return 34
|
||||
end,
|
||||
label = function(Out, ...)
|
||||
vals = 0
|
||||
value = 0
|
||||
message = "("
|
||||
local vals = 0
|
||||
local message = "("
|
||||
for k,v in ipairs(arg) do
|
||||
vals = vals + 1
|
||||
--value = value + v
|
||||
message = message .. v .. " + "
|
||||
end
|
||||
message = string.sub(message,1,-4)
|
||||
message = message .. ") / " .. vals .. " = " .. Out
|
||||
return message
|
||||
--return "I ARE FAIL"
|
||||
end
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user