Questions tagged as 'random'

3
answers

Random Audio on page

I always wanted someone to enter a page to play some random random ale in a folder. I tried to use this <?php $dir_path = "data/"; $extensions_array = array('mp3'); if(is_dir($dir_path)) { $files = scandir($dir_path); for($i =...
asked by 17.05.2017 / 18:22
1
answer

Function rand () does not return random numbers. C ++

I have a function that needs to generate, in a specific part, a random number to do a certain task. But whenever the program enters this function, the number generated does not change, always being zero. Here is the code: do{ // Garante que se...
asked by 17.10.2016 / 20:09
2
answers

How to generate a vector using Random to assign values, but to make it never have repeated values? [duplicate]

I'm working on a Bingo in C # for a facul job and I need to do a vector of so many values and do not ever repeat those values, I'm using the following procedure to generate the raffle values ↓ public static void GeraBingo(int[] v)...
asked by 10.05.2016 / 18:35
1
answer

C file manipulation (skip lines)

Hello, I have a problem with skipping lines in a file, I use fgets (), but it always prints the first line of my file. Home I also did some tests, and for some reason, only one iteration occurs and x enters the if with the value of random. Home N...
asked by 10.03.2016 / 21:12
1
answer

Randomization / Randomization C #

Good. I'm trying to create a snake game in C # and I have no idea how I can make a new fruit appear in a random place when the snake gets some fruit.     
asked by 07.09.2015 / 00:03
2
answers

Problem with random values

Good evening, guys. I am solving an exercise where I must, at each execution, generate a random number and then turn it into letter. For this I made a function. It is almost all right, the number is generated and is transformed into letter...
asked by 15.04.2015 / 07:24
1
answer

Create function that returns random numbers in C

I need to create a function that returns random numbers without repeating between 2 ranges. I wanted to create a kind of a card game, where the cards are shuffled, and when they come back they never go out again. In my code you are repeati...
asked by 25.11.2014 / 20:04
1
answer

Python: 'int' object is not iterable Random function

I'm having this error when I run the code. If I set pos=(algum numero qualquer) the code runs normally, but if I use this random function of the error.    'int' object is not iterable on line 20 at the beginning. Where am I goin...
asked by 01.04.2018 / 20:18
1
answer

How to open a random image

I have a new question and this has been the best place to find answers, since thanks. My problem and the following, I'm doing a school questionnaire for my son. And a simple thing, at least it should be. A question with 3 answers, one right and...
asked by 02.07.2017 / 16:03
2
answers

Add the random data

I have a code for a data roller. Then the person will type in the field the amount of data that will roll and after that the program will rotate the amount of data and add up. Then I made an array to receive this data but I can not add them...
asked by 07.07.2017 / 23:48