Skip to main content

Questions tagged [random]

This tag is for questions pertaining to random numbers, whether pseudo random or truly random.

5 votes
1 answer
190 views

A simple random password generator in C#. Looking for any improvements around speed or design. Any char[] can be passed to choose random chars from. The array I ...
Short Int's user avatar
  • 762
2 votes
1 answer
152 views

I wrote this code below to get all possible words for an array containing \$n\$ letters. The logic of the code is that the letters of the array are mixed up in random positions and checks if this ...
John's user avatar
  • 59
4 votes
2 answers
254 views

I have tried to implement the Array-shuffle method myself. Haven't had a look on some similar algorithm-examples by purpose and tried to figure out something myself. The actual Array-extension: ...
michael.zech's user avatar
  • 5,042
7 votes
3 answers
582 views

I've made a program for randomly splitting game participants into different teams. The code works and solves the problem. I'm interested in advice on what you'd do differently or better. ...
tomi bell's user avatar
5 votes
1 answer
155 views

Is there a way to significantly speed-up this code? I'm solving a dynamic programming model using a backward induction algorithm. A crucial step is to calculate the current-period value function (VF), ...
manifold's user avatar
  • 151
2 votes
1 answer
138 views

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++, rand Template Function Implementation for Image in C++, randi Template ...
JimmyHu's user avatar
  • 7,575
5 votes
1 answer
302 views

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++, rand Template Function Implementation for Image in C++ and randi Template ...
JimmyHu's user avatar
  • 7,575
6 votes
1 answer
267 views

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++ and rand Template Function Implementation for Image in C++. I implemented <...
JimmyHu's user avatar
  • 7,575
5 votes
6 answers
2k views

I want to make a bubble sorting algorithm of 10 random (non-repeating) numbers from 0-50. I changed many aspects of it while making it and finally got it to work, but I would like to see if there's ...
asuno__'s user avatar
  • 61
4 votes
3 answers
162 views

I am learning Rust and would like a review to make sure I am following best Rust practices before continuing. The user enters a number between 1 and 100 up to 6 times to guess the randomly-generated ...
Hosch250's user avatar
6 votes
1 answer
280 views

I took the basic structure from this link and wrote the following class. Can you review the code? Can you find a silent bug? ...
user366312's user avatar
6 votes
1 answer
383 views

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++. I am trying to mimic Matlab's rand function into TinyDIP library. The ...
JimmyHu's user avatar
  • 7,575
4 votes
1 answer
175 views

I implemented a simple function that generated random bytes Vec<u8> with given n size. Then I wondered how can I optimize ...
marknikky's user avatar
5 votes
1 answer
161 views

I tried to make a cryptographically secure random int in range generator for javascript, practically the javascript equivalent of php's random_int(min,max): ...
hanshenrik's user avatar
18 votes
2 answers
1k views

Password generators are extremely popular on CodeReview with beginners to both coding in general and Python in particular, for a number of reasons: They're (seemingly) easy to implement They offer an ...

15 30 50 per page
1
2 3 4 5
55