Skip to main content
0 votes
1 answer
81 views

I am trying to make a streak to my roulette command when the 1/4 chance fails (a miss). I want it to be when a user gets a miss, their streak goes up by one, but if a user gets a hit the streak resets ...
Gaming Filter's user avatar
1 vote
1 answer
151 views

I have legacy code written in Visual Basic 6. It uses Rnd and Randomize to produce an output given an initial random seed. These are the rtcRandomNext and rtcRandomize functions in the MSVBM60.DLL, ...
Kuba hasn't forgotten Monica's user avatar
0 votes
1 answer
111 views

I am making an rng function in C with an upper bound. However, I'm always getting the same sequence of numbers - 3675356291. This is the file I'm using: // The #include block. Contains the header ...
pere T's user avatar
  • 11
Best practices
1 vote
5 replies
133 views

Given an input string, I want to generate a "random" number between 0 and 1. However given the same input string, the returned value should stay the same. I tried something like: Random ...
Nathan H's user avatar
  • 49.7k
4 votes
8 answers
304 views

Starting with the example dat0 below, let's say I want to randomly extract 3 pairs of ìd`s. Initial data (5 id pairs) dat0 <- structure(list(id = c("A", "A", "B", &...
denis's user avatar
  • 1,248
0 votes
1 answer
61 views

In a v12 TYPO3 site running EXT:news 12.3.0 I'd like to display a random selection of news articles, maintaining other chosen restraints (as limit to categories, respect top news etc.). Best practice ...
webman's user avatar
  • 1,204
2 votes
1 answer
318 views

Recently, on a project, I encountered the need for uniformly distributed integers within an arbitrary range [a, b] from random bytes, a problem that is quite common and is usually solved using ...
Marz's user avatar
  • 23
1 vote
1 answer
128 views

I have a simple example for random stability in QuestaSim. module sv_rand_stability; class dummy; rand int data; endclass initial begin dummy d; $display("%...
Sergey Chusov's user avatar
0 votes
2 answers
114 views

I have a beginner Python program that generates random output and does not take any input. For example, it simulates rolling a dice 5 times and prints the results, their sum, and average: import ...
userfh's user avatar
  • 49
1 vote
1 answer
108 views

I've been digging into "true" randomness idea, and I've noticed that modern CPUs support instructions for generating randomness. X64 has RDRAND instruction, while ARM has RNDR (I'm not ...
freakish's user avatar
  • 57.1k
0 votes
0 answers
86 views

I have the following code to calculate and visualise the probability of scoring 10 points or more This is the Scoreboard image that I used to run the code from PIL import Image, ImageDraw import ...
Nemo's user avatar
  • 1,306
0 votes
0 answers
70 views

I'm trying to fetch random posts using the WordPress REST API, but the orderby=rand parameter is not working as expected. Instead of returning random posts on each request, it consistently returns the ...
User's user avatar
  • 24.9k
4 votes
3 answers
174 views

I want to iterate through a list of size n, with A 1s in it (the rest are 0s), and I want the 1s randomly distributed. n and A are large, so I'm trying to make a generator instead of a list. If they ...
WeCanDoItGuys's user avatar
6 votes
3 answers
266 views

I need to generate a random integer from 0 (inclusive, but it doesn't matter) to p*q (exclusive, but it doesn't matter) that is divisible by neither p nor q. It just so happens that p and q are ...
nonhuman's user avatar
  • 141
-6 votes
2 answers
198 views

I'm trying to reorder the randomly generated numbers of a set, and I don't know how to do so: import numpy as np import random as rd NUMBER=5 c = np.zeros(NUMBER+1) for k in range(1,NUMBER+1): ...
Médicis's user avatar

15 30 50 per page
1
2 3 4 5
2387