random tag

39 questions


1 answers
61 views
0
Why does "hello world" keep coming out when I write random?

Why is hello world always printed on the source code below? System.out.println(randomString(-229985452) + + randomString(-147909649)); public static String randomString(int i) { Random ran = new Ra...

2 years ago

1 answers
81 views
0
How to draw any number from 0 to 9

[0,9] I want to randomly pick a number in the range. What should I do?

2 years ago

1 answers
63 views
0
I'd like to ask you a question about the code for creating a java lottery number

import java.util.*;//lotto numberpublic class Pre4 {public static void main(String[] args){ Random rann = new Random(); int[] a = new int[45]; int[] b = new int[7]; for(int q=0;q<a.length;q++){ a[...

2 years ago

1 answers
75 views
0
discord.js random image question

// Send hikari's imageclient.on('message', message => { if (message.content.startsWith (hikari)) { const hikari = [ 'https://example/giphy.gif', 'https://example/giphy2.gif', 'https://example/g...

2 years ago

3 answers
76 views
0
c++ generation of random numbers

#include <cstdlib>#include <ctime>#include <iostream>using namespace std;int main() { srand(time(0)); int num = rand()%101; for(int i = 0; i <=9; i++){ cout << num << ...

2 years ago

1 answers
77 views
0
Python List

Save 'grave', 'banana', 'gravefruit' and 'melon' as elements in the list named Fruit, mix them with random module functions, and then how do I write the first element to display the message 'correct' ...

2 years ago

1 answers
58 views
0
the beetle problem

#include <stdio.h>#include <time.h>#define ROWS 20#define COLS 20int main(void){ srand((unsigned)time(NULL)); char dot[ROWS][COLS]; for (int i = 0; i < ROWS; i++) { for (int j = 0; j &...

2 years ago

1 answers
136 views
0
Python random.shuffle function/list/tuple TypeError: 'NoneType' object is not usable

Hello! While I was working on this and that with what I learned, I thought I could randomly extract two lists at once and make a code, but in the A=tuple(a) step, it said TypeError: 'NoneType' object ...

2 years ago

1 answers
82 views
0
I'd like to specify a specific order when selecting Python characters randomly, is it possible?

d = np.random.choice(['A', 'B', 'C', 'D'], 30, p=[0.4, 0.4, 0.1, 0.1])print(d)From the above code Can I set it to turn the same character back to random if it comes out 3 times in a row like AAA?I'd l...

2 years ago
« - 4 -

© 2024 OneMinuteCode. All rights reserved.