Questions tagged as 'random'

1
answer

Random speed on Java threads

I have done a small program simulating a race with three threads. My idea is to put these speeds with randoms number so that the result varies, but I do not know how to do it. Code: public class Carrera extends Thread { String nombre;...
asked by 28.10.2017 / 18:12
1
answer

Modify global variables

I was doing a very simple program that consists of the user choosing a number between one and one hundred and the computer tries to guess it. If the computer does not guess, you should tell it if the number you chose is a number higher or low...
asked by 21.09.2017 / 22:43
3
answers

How to generate two whole Randoms in Java

How can I generate a random number of whole characters in java a = Math.random () * 25 + 1;  System.out.println (Math.round (a)) // the 25 sets the limit     
asked by 13.02.2018 / 03:38
1
answer

libwinpthread-1.dll, libgcc_s_seh-1.dll and error 0xc000007b

I use the IDE CLION to program in C ++, and it took very little time. I'm doing a mini-game on the console where I need to generate random numbers. Use rand () with the standard library and time (), but the environment recommends me to use a di...
asked by 18.01.2018 / 21:00
0
answers

I want to print a random string of my Array

It does not let me print a random string from my list private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { srand(time(0)); std::string word[] = {"black","metal"}; for (int i = 0; i < 1; i++) {...
asked by 01.01.2017 / 23:48
2
answers

make a string random, which I select the following results, ignoring the ones that were already obtained

I have been asked to do a program which asks me random questions which will be answered true or false; my problem is to make a string for this, but do not make the random do not repeat the questions that I did previously the code would be som...
asked by 16.10.2018 / 00:57
1
answer

Random generates the same result several times

string nombre; public string gen2(int Name_Len) { string[] abc = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; if (Name_Len >= 5)...
asked by 06.08.2017 / 20:09
1
answer

Obtain data randomly from the database with CodeIgniter

It turns out that I need to get random data from the database with the CodeIgniter framework. in database I have a table called phrases and within it two fields: Type and phrase In the field type I have 1 which has...
asked by 23.12.2016 / 16:07
2
answers

Run WordPress Hook from Javascript

Greetings Friends, I have the following WP Hook: add_action('template_redirect','random_template'); function random_template() { $posts = get_posts('post_type=post&orderby=rand&numberposts=1'); foreach($posts as...
asked by 03.06.2017 / 20:01
1
answer

How do I get this random game to work properly with Javascript? [closed]

I'm just learning javascript and to practice I had the idea of doing an English / Spanish game. The game basically consists in that in the title a Colombian idiom appears and below in some pictures some definitions that could be of that i...
asked by 26.12.2018 / 21:16