Code format

This commit is contained in:
2025-05-15 20:37:50 +02:00
parent 9e6432d0b0
commit 69d1f9fd93
105 changed files with 24069 additions and 28084 deletions

View File

@@ -71,7 +71,7 @@ local function tonum(cchar)
end
local function findcollision(hash_table, array)
local collisions = 0
for k,v in ipairs(hash_table) do
for k, v in ipairs(hash_table) do
for i = 1, table.getn(hash_table) do
if i ~= k then
if hash_table[i] == hash_table[k] then
@@ -83,14 +83,14 @@ local function findcollision(hash_table, array)
end
return collisions
end
aura_env.tohash = function(tempvar)
aura_env.tohash = function(tempvar)
local charTable = {}
local hash = 0
for char in tempvar:gmatch("%a") do
charTable[#charTable + 1] = char
hash = hash + tonum(char)
hash = hash / table.getn(charTable)
end
end
hash = math.floor(hash * 10000)
return hash
--print(aura_env.spellarray[hash], hash)
@@ -98,4 +98,4 @@ end
aura_env.checkbase = function(spell)
if aura_env.spellarray[aura_env.tohash(spell)] == nil then return 0 end
if aura_env.spellarray[aura_env.tohash(spell)] == spell then return 1 end
end
end