Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-scripts-888
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-scripts-888
Commits
70ab2010
Commit
70ab2010
authored
Jul 14, 2025
by
Vury Leo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tuning 白の枢機竜
parent
6c193bc3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
37 deletions
+63
-37
procedure.lua
procedure.lua
+63
-37
No files found.
procedure.lua
View file @
70ab2010
...
@@ -3646,51 +3646,77 @@ function Fusion.StrictGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf)
...
@@ -3646,51 +3646,77 @@ function Fusion.StrictGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf)
return
Fusion
.
FinalCheck
(
e
,
mg
,
tc
,
fgoalcheck
,
chkf
)
return
Fusion
.
FinalCheck
(
e
,
mg
,
tc
,
fgoalcheck
,
chkf
)
end
end
-- Search mode: find *some* s
ize‐grp.min subset
that passes
-- Search mode: find *some* s
ubset of size [grp.min…grp.max]
that passes
function
Fusion
.
SearchGroup
(
e
,
leftovers
,
mg_base
,
grp
,
tc
,
fgoalcheck
,
chkf
)
function
Fusion
.
SearchGroup
(
e
,
leftovers
,
mg_base
,
grp
,
tc
,
fgoalcheck
,
chkf
)
-- filter leftovers
by grp.filter
-- pre‐filter
by grp.filter
local
matched
=
{}
local
matched
=
{}
for
_
,
c
in
ipairs
(
leftovers
)
do
for
_
,
c
in
ipairs
(
leftovers
)
do
if
not
grp
.
filter
or
grp
.
filter
(
c
,
tc
)
then
if
not
grp
.
filter
or
grp
.
filter
(
c
,
tc
)
then
table.insert
(
matched
,
c
)
table.insert
(
matched
,
c
)
end
end
end
end
if
#
matched
<
grp
.
min
then
return
false
end
if
#
matched
<
grp
.
min
then
local
comb
=
{}
local
function
dfs_comb
(
start
,
depth
)
if
depth
>
grp
.
min
then
-- subset built in comb[1..grp.min]
local
subG
=
Group
.
FromCards
(
table.unpack
(
comb
))
-- has_same
if
grp
.
has_same
and
not
Fusion
.
CheckHasSame
(
grp
,
subG
,
e
)
then
return
false
return
false
end
end
-- unique_by
-- early UniqueByMatching prune for max size
if
grp
.
unique_by
then
if
grp
.
unique_by
then
local
matcher
=
Fusion
.
UniqueByMatching
(
grp
.
unique_by
,
grp
.
min
)
local
matcher
=
Fusion
.
UniqueByMatching
(
grp
.
unique_by
,
grp
.
min
)
if
not
matcher
(
comb
)
then
if
not
matcher
(
matched
)
then
return
false
return
false
end
end
end
end
-- merge & final
local
mg
=
mg_base
:
Clone
()
local
comb
=
{}
mg
:
Merge
(
subG
)
return
Fusion
.
FinalCheck
(
e
,
mg
,
tc
,
fgoalcheck
,
chkf
)
local
function
dfs
(
start
,
depth
)
-- If we have at least grp.min cards, test this subset immediately
if
depth
>=
grp
.
min
then
-- build subset group and merged material group
local
subG
=
Group
.
FromCards
(
table.unpack
(
comb
,
1
,
depth
))
local
mg_tmp
=
mg_base
:
Clone
()
mg_tmp
:
Merge
(
subG
)
-- has_same check
local
ok_same
=
not
grp
.
has_same
or
Fusion
.
CheckHasSame
(
grp
,
subG
,
e
)
-- unique_by check
local
ok_unique
=
true
if
grp
.
unique_by
then
local
matcher
=
Fusion
.
UniqueByMatching
(
grp
.
unique_by
,
depth
)
ok_unique
=
matcher
(
comb
)
end
-- final fusion checks
if
ok_same
and
ok_unique
and
Fusion
.
FinalCheck
(
e
,
mg_tmp
,
tc
,
fgoalcheck
,
chkf
)
then
return
true
end
end
-- Stop recursing if we've hit grp.max
if
depth
==
grp
.
max
then
return
false
end
end
for
i
=
start
,
#
matched
-
(
grp
.
min
-
depth
)
+
1
do
-- Prune if not enough cards remain to reach grp.min
comb
[
depth
]
=
matched
[
i
]
if
#
matched
-
start
+
1
+
depth
<
grp
.
min
then
if
dfs_comb
(
i
+
1
,
depth
+
1
)
then
return
false
end
-- Otherwise, try adding one more card
for
i
=
start
,
#
matched
do
comb
[
depth
+
1
]
=
matched
[
i
]
if
dfs
(
i
+
1
,
depth
+
1
)
then
return
true
return
true
end
end
comb
[
depth
+
1
]
=
nil
end
end
return
false
return
false
end
end
return
dfs_comb
(
1
,
1
)
-- kick off the DFS
return
dfs
(
1
,
0
)
end
end
-- Shared has_same checker (bitmask or key‐list)
-- Shared has_same checker (bitmask or key‐list)
function
Fusion
.
CheckHasSame
(
grp
,
group_obj
,
e
)
function
Fusion
.
CheckHasSame
(
grp
,
group_obj
,
e
)
local
cards
=
{}
local
cards
=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment