# Questions tagged as 'random'

1

## Generate random numbers in C?

I need to generate 5 random numbers in a range between -10 and +10. How could I do this? I've already seen that you can use shuffle , malloc or even realloc , but being new to C, I do not quite understand how I can make it w...
2

## Generate random number with current date and time value with Javascript

I would like to know how to generate a random number, based on the current date and time value, using Javascript. I could not get a real example to show here, because I really do not know how to do it.
1

## Strange behavior of the rand () function

By setting the documentation echo rand() // Imprime algo completamente aleatório echo rand(\$min, \$max) // Imprime algo em um range entre min e max In a code, inside a loop, I accidentally generated the following rand(\$max, \$min) I...
2

## How not to repeat random numbers?

I'm creating a rotating banner, and for this I use the random javascript that draws a position in the array and displays, this already works well, the problem is that sometimes it draws the same number at random and repeats what is being display...
1

## Random number list without repeating Android

I have an ArrayList with N items inside and I need to group them randomly into 2 sets of X items and the rest into another set. However, none of them can be repeated. For example: my ArrayList has 20 items added and I want to split it into 2...
2

## Generate random number without repetition in C

Hello, I am making a memory game in c, and would like to know how to generate a random number without repetition. I will post what in the function so far. Do I need to do another function only to check if there is a repeated number? void preen...
1

## How to ignore certain elements in a list that will undergo a random process? (pending)

This program finds magic squares 3x3 by brute force and automatically prints when you find one. code: import random vetor = [1, 2, 3, 4, 5, 6, 7, 8, 9] def magicsquare(): return vetor[0]+vetor[1]+vetor[2]==\ vetor[3]+vetor[...
2

## Generate random numbers from a predefined set

How to generate a random number in a range of non-sequential numbers. For example, a function that randomly chooses between values, 3, 10, 20, and 2334 in the C language
0