549e9430f8 2024-02-13 1: -- 不用这套方案了
549e9430f8 2024-02-13 2: --~ 卡对排
f1bea6a75e 2024-02-13 3: function d.荐名(u1_0)
0a84ce44ba 2024-02-13 4: local h1_0
549e9430f8 2024-02-13 5: --~ 卡名对
f1bea6a75e 2024-02-13 6: h1_0 = 历对库.历对(u1_0, d.卡对消重)
0a84ce44ba 2024-02-13 7: return 对库.对长(h1_0)
549e9430f8 2024-02-13 8: end
549e9430f8 2024-02-13 9: --~ 卡对
f1bea6a75e 2024-02-13 10: function d.卡对消重(u1, u1_0)
f1bea6a75e 2024-02-13 11: return u1_0.name, true
549e9430f8 2024-02-13 12: end
549e9430f8 2024-02-13 13: --~ 卡对排
f1bea6a75e 2024-02-13 14: function d.荐名(u1_0)
89f423ff38 2024-02-13 15: local h1, h2
0a84ce44ba 2024-02-13 16: local h1_0
549e9430f8 2024-02-13 17: --~ 攻击力排
f1bea6a75e 2024-02-13 18: h1_0 = 历排库.历排(u1_0, 筛卡库.筛怪兽卡)
0a84ce44ba 2024-02-13 19: h1_0 = 历排库.历排(h1_0, 筛卡库.筛攻击力)
0a84ce44ba 2024-02-13 20: if h1_0[1] then
549e9430f8 2024-02-13 21: --~ 攻击力均差阶
89f423ff38 2024-02-13 22: h1 = 排算库.均差(h1_0)
89f423ff38 2024-02-13 23: if h1 > 0 then
549e9430f8 2024-02-13 24: --~ 补值
89f423ff38 2024-02-13 25: h2 = 数库.指数(100, 基算库.除法(h1, 300))
89f423ff38 2024-02-13 26: h1 = 基算库.除法(基算库.加法(h1, h2), 100)
89f423ff38 2024-02-13 27: if h1 > 1 then
89f423ff38 2024-02-13 28: h1 = 数库.指数次(h1, 2)
89f423ff38 2024-02-13 29: return 数库.向下取整(h1)
549e9430f8 2024-02-13 30: else
549e9430f8 2024-02-13 31: return 0
549e9430f8 2024-02-13 32: end
549e9430f8 2024-02-13 33: else
549e9430f8 2024-02-13 34: return 0
549e9430f8 2024-02-13 35: end
549e9430f8 2024-02-13 36: else
549e9430f8 2024-02-13 37: return 0
549e9430f8 2024-02-13 38: end
549e9430f8 2024-02-13 39: end
549e9430f8 2024-02-13 40: --~ 卡对排
f1bea6a75e 2024-02-13 41: function d.荐名(u1_0)
89f423ff38 2024-02-13 42: local h1
549e9430f8 2024-02-13 43: --~ 名
89f423ff38 2024-02-13 44: h1 = d.荐字段名(u1_0)
89f423ff38 2024-02-13 45: if h1 then
549e9430f8 2024-02-13 46: else
89f423ff38 2024-02-13 47: h1 = d.荐卡名(u1_0)
549e9430f8 2024-02-13 48: end
89f423ff38 2024-02-13 49: if h1 then
89f423ff38 2024-02-13 50: return h1
549e9430f8 2024-02-13 51: else
549e9430f8 2024-02-13 52: return "请便"
549e9430f8 2024-02-13 53: end
549e9430f8 2024-02-13 54: end
549e9430f8 2024-02-13 55: --~ 卡对排
f1bea6a75e 2024-02-13 56: function d.荐卡名(u1_0)
0a84ce44ba 2024-02-13 57: local h1_0
549e9430f8 2024-02-13 58: --~ 卡名排
f1bea6a75e 2024-02-13 59: h1_0 = 历排库.历排(u1_0, d.取卡名)
0a84ce44ba 2024-02-13 60: return 历排取一库.筛最短文(h1_0)
549e9430f8 2024-02-13 61: end
549e9430f8 2024-02-13 62: --~ 卡对
f1bea6a75e 2024-02-13 63: function d.取卡名(u1_0)
f1bea6a75e 2024-02-13 64: return u1_0.name
549e9430f8 2024-02-13 65: end
549e9430f8 2024-02-13 66: --~ 卡对排
f1bea6a75e 2024-02-13 67: function d.取字段对(u1_0)
89f423ff38 2024-02-13 68: local h1, h2, h3, h4
0a84ce44ba 2024-02-13 69: local h1_0
549e9430f8 2024-02-13 70: --~ 字段对
0a84ce44ba 2024-02-13 71: h1_0 = {}
f1bea6a75e 2024-02-13 72: for u1 = 1, #u1_0 do
f1bea6a75e 2024-02-13 73: --~ 字段数
89f423ff38 2024-02-13 74: h1 = 字节库.to_uint64(u1_0[u1].setcode)
89f423ff38 2024-02-13 75: if h1 < 1 then
f1bea6a75e 2024-02-13 76: else
89f423ff38 2024-02-13 77: if h1 > 0xffffFFFFffff then
89f423ff38 2024-02-13 78: h1 = h1 - 1
f1bea6a75e 2024-02-13 79: else
f1bea6a75e 2024-02-13 80: for u2 = 1, 11112222 do
89f423ff38 2024-02-13 81: if h1 < 1 then
549e9430f8 2024-02-13 82: break
549e9430f8 2024-02-13 83: else
549e9430f8 2024-02-13 84: --~ 大字段号
89f423ff38 2024-02-13 85: h2 = 位算库.位和(h1, 0xffff)
89f423ff38 2024-02-13 86: h1 = 位算库.位右移(h1, 基算库.乘法(4, 4))
549e9430f8 2024-02-13 87: --~ 字段名
89f423ff38 2024-02-13 88: h3 = 字段名对[tonumber(h2)]
89f423ff38 2024-02-13 89: if h3 then
89f423ff38 2024-02-13 90: if h1_0[h3] then
89f423ff38 2024-02-13 91: h1_0[h3] = 基算库.加法(h1_0[h3], 1)
549e9430f8 2024-02-13 92: else
89f423ff38 2024-02-13 93: h1_0[h3] = 1
549e9430f8 2024-02-13 94: end
89f423ff38 2024-02-13 95: if h2 > 0xfff then
549e9430f8 2024-02-13 96: --~ 小字段号
89f423ff38 2024-02-13 97: h4 = 位算库.位和(h2, 0xfff)
89f423ff38 2024-02-13 98: h3 = 字段名对[tonumber(h4)]
89f423ff38 2024-02-13 99: if h3 then
89f423ff38 2024-02-13 100: if h1_0[h3] then
89f423ff38 2024-02-13 101: h1_0[h3] = 基算库.加法(h1_0[h3], 1)
549e9430f8 2024-02-13 102: else
89f423ff38 2024-02-13 103: h1_0[h3] = 1
549e9430f8 2024-02-13 104: end
549e9430f8 2024-02-13 105: else
549e9430f8 2024-02-13 106: end
549e9430f8 2024-02-13 107: else
549e9430f8 2024-02-13 108: end
549e9430f8 2024-02-13 109: else
549e9430f8 2024-02-13 110: end
549e9430f8 2024-02-13 111: end
549e9430f8 2024-02-13 112: end
549e9430f8 2024-02-13 113: end
549e9430f8 2024-02-13 114: end
549e9430f8 2024-02-13 115: end
0a84ce44ba 2024-02-13 116: return h1_0
549e9430f8 2024-02-13 117: end
549e9430f8 2024-02-13 118: --~ 卡对排
f1bea6a75e 2024-02-13 119: function d.荐字段名(u1_0)
89f423ff38 2024-02-13 120: local h1
0a84ce44ba 2024-02-13 121: local h1_0
549e9430f8 2024-02-13 122: --~ 字段对
f1bea6a75e 2024-02-13 123: h1_0 = d.取字段对(u1_0)
549e9430f8 2024-02-13 124: --~ 最大的字段名数量
89f423ff38 2024-02-13 125: _, h1 = 历对取一库.筛最大值(h1_0)
549e9430f8 2024-02-13 126: --~ 最高频字段名对
89f423ff38 2024-02-13 127: h2_0 = 历对库.历对(h1_0, 历对库.全等筛值, h1)
caceb3cbb9 2024-02-13 128: return 历对取一库.筛最短键(h2_0)
549e9430f8 2024-02-13 129: end