CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 18:54:28 GMT
content-type: text/html; charset=utf-8
cf-ray: 965e586ef82dc1bf-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=2937c970-da51-4228-a9f1-e6f7256624aa; expires=Mon, 27 Jul 2026 18:54:27 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: 41b01cbd-5502-42ac-b57f-a2a6c2474feb
x-worker-origin-response-time: 583000000
x-dns-prefetch-control: off
set-cookie: prov=2937c970-da51-4228-a9f1-e6f7256624aa; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=RmTWhbR1FuWf.2HzehLpuT1cRuhMVznimoBf.GDKRFQ-1753642468-1.0.1.1-F6i4SbmkWg_0NBcIqRtGkXYDBH6VjdqokyDaeNYhzmEduxplemaJb7Ng.hd4ZVUOZaE6aA6urC7NraQI3TW5hY69oKl3xaybdc_Qei4zMKs; path=/; expires=Sun, 27-Jul-25 19:24:28 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=HygqeikTOCUiYw7pAsFiNKX70wNSx9YpX4FJUmOe4bE-1753642468274-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'random' Questions - Code Review Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [random]
This tag is for questions pertaining to random numbers, whether pseudo random or truly random.
810 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
4
votes
2
answers
232
views
Ruby Array#own_shuffle method
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:
...
7
votes
3
answers
549
views
Team picker command line application
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.
...
2
votes
0
answers
94
views
backward induction algorithm computation
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), ...
2
votes
1
answer
102
views
randi Template Function Implementation for Image in C++ (Rev.3)
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 ...
5
votes
1
answer
262
views
randi Template Function Implementation for Image in C++ (Rev.2)
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 ...
6
votes
1
answer
244
views
randi Template Function Implementation for Image in C++
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 <...
5
votes
6
answers
2k
views
Bubble sort with 10 random numbers
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 ...
4
votes
3
answers
122
views
Number guessing game in Rust
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 ...
6
votes
1
answer
262
views
A PCG-based random number generator that is interchangeable with System.Random
I took the basic structure from this link and wrote the following class.
Can you review the code?
Can you find a silent bug?
...
6
votes
1
answer
352
views
4
votes
1
answer
131
views
Generating random bytes
I implemented a simple function that generated random bytes Vec<u8> with given n size. Then I wondered how can I optimize ...
5
votes
1
answer
143
views
Cryptographically secure random int in range
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):
...
15
votes
1
answer
1k
views
Typical password generator in Python
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 ...
4
votes
3
answers
176
views
Efficiently generate a random position inside an outer rectangle but outside an inner rectangle
It should be a uniform distribution (ie: every point is equally as likely). I also don't want to use the simple solution of: "in a loop check to see if the current generated point is within the ...
6
votes
1
answer
590
views
Generate unique temporary file names in C++20
WARNING: do not use this solution
See discussion in the accepted answer's comments. Basically, this solution would reproduce std::tmpnam's and ...
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
python × 253
c++ × 121
beginner × 120
java × 117
performance × 82
python-3.x × 80
c# × 71
javascript × 67
game × 54
strings × 54
simulation × 52
algorithm × 41
dice × 40
c × 39
array × 36
php × 36
c++11 × 29
object-oriented × 24
python-2.x × 23
security × 21
password-generator × 20
shuffle × 20
numerical-methods × 18
haskell × 17
playing-cards × 17
more related tags
Hot Network Questions
- Partitioning heaps - Why?
- Is there such a thing as 'aerospace grade software'?
- How can my dwarves keep humans from reverse engineering their technology?
- Alternative to tedious assert-rewrite for trivial operations?
- Hypothetical copyleft exposure developer on proprietary project, legal?
- how is it possible for a player to have crossed 2400 and secure 3+ IM norms to stay FM
- Lower bound on ratio of expected maxima of i.i.d. samples from distribution on [0,1]
- How to change opamp variable resistor to fixed resistor?
- Why doesn't the Windows C compiler reuse incoming shadow space in noreturn functions?
- Blinded despite Blindsight?
- Did Denmark report that 64% Palestinian refugees from 1992 received serious fines or jail time?
- Does SZNUD3160 really eliminate the need for diode?
- Is a Physics and Math double major worth it?
- Why aren't there baleen whales at about the size of a dolphin?
- What Isp can be gotten from a napthalene (mothball) hot gas thruster? Did it work in space?
- When was the last time all humans were on the ground not in the air?
- How to put commutative symbol in a commutative diagram?
- What is the Greek word for God used in Codex Sinaiticus? John 1
- What does "enter the hold at arden" mean
- How to deter wasps from an untreated larch fence
- Book recommendations for theistic books about God's existence
- Civilian airplanes with inside fuselage jet engines
- Calculus Books Recommendation
- Are you required to protect trade secrets revealed to you even if you didn't sign an NDA?