mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 19:54:09 +00:00
build: install dev deps with wally
This commit is contained in:
parent
0b37f9cd54
commit
7c48bd2fa4
33 changed files with 120 additions and 358 deletions
|
|
@ -1,54 +0,0 @@
|
|||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local CharmSync = require(ReplicatedStorage.Packages.CharmSync)
|
||||
|
||||
local patch = CharmSync.patch
|
||||
|
||||
local USERS = 1000
|
||||
|
||||
local function generate()
|
||||
local users = {}
|
||||
|
||||
for user = 1, USERS do
|
||||
users[user] = {
|
||||
coins = math.random(1, 2),
|
||||
gems = math.random(1, 2),
|
||||
}
|
||||
end
|
||||
|
||||
return { users = users }
|
||||
end
|
||||
|
||||
local function update(state)
|
||||
state = table.clone(state)
|
||||
state.users = table.clone(state.users)
|
||||
|
||||
for user = 1, USERS do
|
||||
local rng = math.random()
|
||||
|
||||
if rng < 1 / 3 then
|
||||
continue
|
||||
elseif rng < 2 / 3 then
|
||||
state.users[user] = nil
|
||||
else
|
||||
state.users[user] = {
|
||||
coins = math.random(1, 2),
|
||||
gems = math.random(1, 2),
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
return state
|
||||
end
|
||||
|
||||
return {
|
||||
ParameterGenerator = function()
|
||||
local state = generate()
|
||||
return state, update(state)
|
||||
end,
|
||||
Functions = {
|
||||
diff = function(_, a, b)
|
||||
patch.diff(a, b)
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue