Questions tagged as 'random'

3
answers

What is the difference between rand and srand?

I would like if you could explain to me what the difference is, I am very confused with rand and srand, what is the difference? I've searched elsewhere, but I confuse more. Thanks.     
asked by 22.07.2018 / 02:52
4
answers

Randomize

In my method I have a Random variable: public Bitmap getBmp(int nunidades,boolean base){ Bitmap bmp = Bitmap.createBitmap(ladoWidth * nunidades, ladoHeight, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bmp); int nbase =...
asked by 23.05.2017 / 12:27
1
answer

random numbers every so often

Does anyone know how to generate random numbers every minute? Right now I only have one for where it sends 3 data just for nothing, but it sends them instantly, and I need every minute to throw a random number at me. for(int i =0; i<3; i...
asked by 05.11.2018 / 07:02
2
answers

How to get a random number in a range?

I was wondering how you could get a random number in java within a range. The number must be a decimal number that is in a certain range, but random. private Random random = new Random(); random.setSeed((long) (centralPoint.x*456 + centralPoi...
asked by 09.02.2018 / 20:13
1
answer

Set range of values for random.randrange ()

I have a problem in Pygame when trying to get random values within a range with random.randrange , this is my code: import random import pygame WIDTH = 800 HEIGHT = 600 RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) WH...
asked by 25.01.2017 / 00:43
1
answer

I need you to give me 2 different letters

I'm trying to make a poker game to play. The problem is that at the time of telling him that he is giving me two cards from the deck, he gives me only one card twice. For example, you give me Q of heart and Q of heart or...
asked by 29.09.2017 / 06:14
1
answer

Use rand in c to generate a sequence of random numbers that go from 3 to 3?

Is there a simple way in which using rand (without using other functions) can generate random numbers between 45 and 75 (inclusive) and that these are 45,48,51,54,57,60,63,66,69,72,75 (that is, go from 3 to 3)? I know how to perform th...
asked by 26.01.2018 / 14:09
2
answers

Return a random value from an array

I am trying to get a function to return a random string from an array of strings but it looks like I am not passing the parameters to the function correctly. The problem is in the main.cpp This is my code: Player.h #ifndef PLAYER_H #defi...
asked by 14.06.2018 / 13:26
1
answer

Assign hours with a random with priodities

After searching on Google and not finding anything like that. It occurred to me to make an array of this style $orden= array(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6...
asked by 16.02.2018 / 13:08
1
answer

List of lists of random numbers python

I want to know how to implement the matrizAleatoria(a) function, which completes the list of a lists with random numbers using random.random() (the function does not return anything, you only have to modify a) I wrote the...
asked by 23.10.2018 / 22:01