Questions tagged as 'random'

1
answer

How to generate random value pairs

I wanted to generate 6 random values in 2 pairs for example 1 1, 2 2, 3 3, but I'm not getting my code My code #include <stdio.h> #include <time.h> #include <stdlib.h> int vezes(int vetor[], int tamanho, int numero);...
asked by 16.07.2018 / 01:08
1
answer

Function that makes $ foo [array_rand ($ foo)] direct

Is there a native PHP function that does this without having to use array_rand in the array key? While working fine and being a simple slice, here is a simplified example of the doubt: //Declarando um Array com um Array dentro $array...
asked by 01.10.2015 / 19:55
3
answers

Generate random number between two numbers with Math.random [duplicate]

I need to generate a random number between 1000 and 9999 , I found the following formula: (int) (min + Math.random() * (max+1)) Code: int numeroAleatorio = (int) (1000 + Math.Random() * 10000); System.out.println("Thread A: " + numer...
asked by 22.10.2016 / 22:01
1
answer

Insert n points of a vector randomly into any array in java [closed]

I am a beginner in Java, I wanted to know if there is any function that would make my life easier: Having a vector of n positions filled with (pre-defined) numbers, distribute those numbers in randomly array positions. For example: havin...
asked by 28.08.2018 / 04:09
1
answer

Draw of positions of an array

I need to create a function to sort within an array full of 0 with size n x n, four positions to modify the value of only those positions drawn.     
asked by 05.04.2018 / 18:45
2
answers

Pass random values to Matrix

I have a matrix with 30 fixed values, I wanted to know how to generate these same 30 values, however random, if possible with value limit between (2400, 400). How the array is currently: private int[][] coordenadas = { { 238...
asked by 20.10.2015 / 13:49
2
answers

Pass random values to Matrix

I have a matrix with 30 fixed values, I wanted to know how to generate these same 30 values, however random, if possible with value limit between (2400, 400). How the array is currently: private int[][] coordenadas = { { 238...
asked by 20.10.2015 / 13:49