Skip to content

Instantly share code, notes, and snippets.

@Fraktality
Created May 13, 2016 20:05
Show Gist options
  • Save Fraktality/3232f0a4416461ae46f044cbf57e9222 to your computer and use it in GitHub Desktop.
Save Fraktality/3232f0a4416461ae46f044cbf57e9222 to your computer and use it in GitHub Desktop.
local fuzzy = {
NOT = function(x)
return 1 - x
end;
AND = function(x, y)
return x*y
end;
OR = function(x, y)
return x + y - x*y
end;
NOR = function(x, y)
return (1 - x)*(1 - y)
end;
XOR = function(x, y)
return 1 - (1 + x*(y - 1))*(1 + y*(x - 1))
end;
XNOR = function(x, y)
return (1 + x*(y - 1))*(1 + y*(x - 1))
end;
NAND = function(x, y)
return 1 - x*y
end;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment