Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
Lottery
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
余子明
Lottery
Commits
9bf5c032
Commit
9bf5c032
authored
Oct 23, 2019
by
yuz1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新的玩法
parent
1960b27d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
Program.cs
Lottery/Lottery/Program.cs
+22
-0
No files found.
Lottery/Lottery/Program.cs
View file @
9bf5c032
...
...
@@ -58,6 +58,28 @@ namespace Lottery
persons
[
j
].
NewGrade
+=
Person
.
GetRandomBaseGrade
(
persons
[
j
].
BaseGrade
);
}
}
//计分方式4:同分生死斗,每轮结束后如果有分数相同的玩家,随机选一位保留,其余清零。(爽不爽)
for
(
int
m
=
0
;
m
<
persons
.
Count
-
1
;
m
++)
{
List
<
Person
>
PlayerList
=
new
List
<
Person
>();
PlayerList
.
Add
(
persons
[
m
]);
for
(
int
n
=
m
+
1
;
n
<
persons
.
Count
;
n
++)
{
if
(
persons
[
n
].
NewGrade
==
persons
[
m
].
NewGrade
&&
persons
[
n
].
NewGrade
!=
0
)
{
PlayerList
.
Add
(
persons
[
n
]);
}
}
if
(
PlayerList
.
Count
>
1
)
{
int
aliveindex
=
new
Random
().
Next
(
0
,
PlayerList
.
Count
);
for
(
int
k
=
0
;
k
<
PlayerList
.
Count
;
k
++)
{
if
(
k
==
aliveindex
)
{
continue
;
}
PlayerList
[
k
].
NewGrade
=
0
;
}
}
}
//计分结束,以下为保存及更新显示
Console
.
Clear
();
...
...
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