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
2f3333a4
Commit
2f3333a4
authored
4 months ago
by
Seilenthal
Browse files
Options
Downloads
Patches
Plain Diff
Random Gnerator V1.1
parent
c77f8329
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
+2
-2
2 additions, 2 deletions
PseudoRandomGenerator.cs
with
2 additions
and
2 deletions
PseudoRandomGenerator.cs
+
2
−
2
View file @
2f3333a4
...
...
@@ -16,7 +16,7 @@ namespace PseudoRandomGenerator
/// <summary>
/// Initializes the LCG with a specified seed to start sequence
/// </summary>
/// <param name="seed">Initial value for generating the sequence (e.g., Dat
a
Time.Now.Ticks)</param>
/// <param name="seed">Initial value for generating the sequence (e.g., Dat
e
Time.Now.Ticks)</param>
public
LCG
(
long
seed
)
{
this
.
seed
=
seed
;
...
...
@@ -39,7 +39,7 @@ namespace PseudoRandomGenerator
/// <param name="min">The inclusive lower bound of the random number</param>
/// <param name="max">The exclusive upper bound of the random number</param>
/// <returns>A pseudo-random integer between min and max</returns>
public
long
Next
(
int
min
,
int
max
)
public
int
Next
(
int
min
,
int
max
)
{
// Map the result of Next() to the specified range
return
(
int
)(
Next
()
%
(
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