CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 04:32:29 GMT
content-type: text/html; charset=utf-8
cf-ray: 965969c2f8f075e9-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=2c142d42-5f1d-444d-bf57-69ebd3d41ae5; expires=Mon, 27 Jul 2026 04:32:28 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: 6ae71ea1-5eb3-44d3-b178-ba133089b991
x-worker-origin-response-time: 540000000
x-dns-prefetch-control: off
set-cookie: prov=2c142d42-5f1d-444d-bf57-69ebd3d41ae5; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=myvp9odEUSUonbQ.lloXqryG0yQwSupxycYq_3E2oqs-1753590749-1.0.1.1-5XRuv1fcUTcy1X4Y_AIdfWanru_qStS.gRDx8pe.9QM5WTCwuHI2Ydc6JvB_rOpgT93kV4w.xjfuKP_tuFEZKITyhRQ7fXW75XDkRVm7Pf4; path=/; expires=Sun, 27-Jul-25 05:02:29 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=0UKY4cdZ6qPGMTI3u6E3_Pu6iHDKfWUFXSX5PuNu72o-1753590749195-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
- Is the surface of Mars or the Moon mostly (or relatively) homogeneous, unlike the Earth?
- Early Sailing days in September 1066... Could Harold defeat William at Hastings, if it happened before Stamford Bridge?
- How do I set up a recursive algorithm to repeatedly square root a positive real number?
- How can I turn the text in a PNG file back into text layer?
- Heretofore I think I have been using 'heretofore' incorrectly
- Is it okay to email researchers if I’m a high school student?
- “Unclear step in a math book for entertainment”
- Lay explaination of 'lower evolutionary constraint genes'?
- When and why is fwait necessary when using the 8087 coprocessor?
- rock paper scissors game with randomized system choices. NOT using rnd()
- What's the difference between an eVisa and ETA travel authorization?
- How to extend an MDF shelf?
- Did Denmark report that 64% Palestinian refugees from 1992 received serious fines or jail time?
- how is it possible for a player to have crossed 2400 and secure 3+ IM norms to stay FM
- Tracking stored procedure performance metrics
- Rec Letter from Professor (who I haven't done research with) or from Work Supervisor
- A question about as ..... as comparison
- Likelihood of the data in a Ornstein-Uhlenbeck-like process
- How do Francophones hear "ChatGPT"?
- What is the citation for Augustine's "consensus, non concubitus..."
- About Harp Pedaling for a Pentatonic Glissando
- Word order for a phrase with a number, adjective and noun
- How much of a really big a spaceship could a nuke take out?
- In Jurassic Park, is the lysine dependency intentionally fake (in-universe)?