Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mastermind
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
seilenthalma100744
Mastermind
Commits
5fb65e27
Commit
5fb65e27
authored
4 months ago
by
Seilenthal
Browse files
Options
Downloads
Patches
Plain Diff
Random Generator V1.2)
parent
0f64a7b2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PseudoRandomGenerator.cs
+8
-1
8 additions, 1 deletion
PseudoRandomGenerator.cs
with
8 additions
and
1 deletion
PseudoRandomGenerator.cs
+
8
−
1
View file @
5fb65e27
...
...
@@ -41,8 +41,15 @@ namespace PseudoRandomGenerator
/// <returns>A pseudo-random integer between min and max</returns>
public
int
Next
(
int
min
,
int
max
)
{
long
nextValue
=
Next
();
//Checks if the number is negative
if
(
nextValue
<
0
)
{
// Adds modulo to prevent negative random numbers
nextValue
+=
m
;
}
// Map the result of Next() to the specified range
return
(
int
)(
N
ext
()
%
(
max
-
min
))
+
min
;
return
(
int
)(
n
ext
Value
%
(
max
-
min
))
+
min
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment