random tag

39 questions


1 answers
480 views
0
I want to generate a list of random numbers with the shortest possible code.

I'd like to use the list initialized with random numbers in Unity c#, but the current method will result in a long code as follows.For me, who has become Python, it's very troublesome to write like th...

1 years ago

1 answers
370 views
0
unity I want to generate a beautiful random number list

I'd like to use a list initialized with random numbers in unity c#, but with this method, the code will be this long.For me, who has become python, it's very troublesome to write like this every timeI...

1 years ago

1 answers
356 views
0
Python Random Walks Question

#1, if code is implemented as Python basic typeimport randomposition = 0walk = [position]steps = 1000for i in range(steps): step = 1 if random.randint(0, 1) else -1 position += step walk.append(positi...

2 years ago

2 answers
140 views
0
In some cases, random number generation in C language always results in the same value.

In the code below, num is 0 to 6, but all of them are 4.Seven of num=land()%7 is a number between 0 and that number.Why is it only like this when it's 7?The environment is MacBook Pro, xcode Version 6...

2 years ago

1 answers
116 views
0
random walk with boundary conditions

While generating random numbers on the stage below (3D), when random walking, I wrote the following code using stage as a conditional statement, but sometimes it works well and sometimes it doesn't.I ...

2 years ago

1 answers
119 views
0
The progress bar may or may not output.

In order to print out the process and the scheduled end time of the calculation, I ran the random walk that I asked you before, referring to the process bar written in Qiita, and I don't know why it b...

2 years ago

2 answers
148 views
0
Is it OK that the string of numbers generated by std::random_device is the same every time?

In the MinGW version of GCC, the default constructor of std::random_device generates the same numeric column every time, but is this behavior compliant with the standard?The implementation limitation ...

2 years ago

1 answers
175 views
0
To randomly mix elements in a list

I want to mix the list that stores the objects.random.shuffle I don't know why, but None keeps returning, so I can't write it.I think it's because there's an object in the list, not a normal type like...

2 years ago

1 answers
127 views
0
A negative number is derived from rand() + rand().

rand() is always positiveBut why is land() + land() a mixture of positive and negative numbers?srand(time(NULL)) seeded and spun, is it related to that?Is there a case where rand() returns a negative ...

2 years ago

1 answers
127 views
0
I want to know the simplest way to randomly generate a string in Ruby

I'm embarrassed because it's such a simple question.Except for lowercase letters, I want to randomly extract 8 capital letters. For me,value = ; 8.times{value << (65 + rand(25)).chr}#Including l...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.