Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
0
Merge Requests
0
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
nanahira
ygopro-core
Commits
39279c42
Commit
39279c42
authored
May 06, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ShuffleSetCard: use Fisher-Yates shuffle
parent
416b733f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
libduel.cpp
libduel.cpp
+3
-7
No files found.
libduel.cpp
View file @
39279c42
...
...
@@ -1135,13 +1135,9 @@ int32 scriptlib::duel_shuffle_setcard(lua_State *L) {
seq
[
ct
]
=
pcard
->
current
.
sequence
;
ct
++
;
}
for
(
uint32
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint32
i
=
0
;
i
<
ct
;
++
i
)
{
uint8
s
=
pduel
->
get_next_integer
(
0
,
ct
-
1
);
pcard
=
ms
[
s
];
ms
[
s
]
=
ms
[
i
];
ms
[
i
]
=
pcard
;
}
for
(
int32
i
=
ct
-
1
;
i
>
0
;
--
i
)
{
int32
s
=
pduel
->
get_next_integer
(
0
,
i
);
std
::
swap
(
ms
[
i
],
ms
[
s
]);
}
pduel
->
write_buffer8
(
MSG_SHUFFLE_SET_CARD
);
pduel
->
write_buffer8
(
ct
);
...
...
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