Posts for cyberpotato

Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
Confirming!
Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
Signing up as well, as an individual for now.
Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
Since most of the gameplay is spent waiting for the death animations to play out, the run feels very saccaded and not as fast paced. As a result, the run didn't entertain me too much. Voted meh.
Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
Despite the seeming simplicity of the game, this fast-paced run still displays a lot of varied strategies and definitely kept my attention throughout. It's a bit unfortunate that the run is so short and that the ending feels a bit abrupt (though I think that completing all 69 levels would get a bit repetitive). Yes vote.
Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
The main part of the run was very well executed, even if a bit repetitive at times. The ending definitely makes up for it though, and finishes this run on a high note. Yes vote.
Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
Unfortunately, the gameplay is quite dull and there isn't much for the viewer to be entertained by. Voted no.
Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
That looks good, nice and simple! There are some minor issues with the way you balance it currently though, which means that some of the threads will still finish a lot earlier than others. For example, in your code, the 0th and 2nd threads will both not have any prime numbers (except 0), since they're only checking even numbers. So you can just remove those threads, and have it run a lot faster (though you need to add 2 as a prime number in after). The optimum way to split the threads (for small numbers of threads) is as follows: 1 2 [1] 2 6 [1, 5] 4 12 [1, 5, 7, 11] 6 18 [1, 5, 7, 11, 13, 17] 8 30 [1, 7, 11, 13, 17, 19, 23, 29] 12 42 [1, 5, 11, 13, 17, 19, 23, 25, 29, 31, 37, 41] The first column is the number of threads, the second column is the increment in the loop, and the last column is the starting offset (I used a starting value instead of an ending value like you do). So for example, if you're using 4 threads, the optimum way is to check all the numbers of the form 1 + 12*i, 5 + 12*i, 7 + 12*i and 11 + 12*i (each in a different thread). Some of the numbers in the first column are missing, and that's because it's actually faster to use a smaller number of threads in that case. Anyways, this is all a lot more complicated to implement, especially for a variable number of threads, but if you need speed it would definitely help a lot (eg. for 4 threads it should run about 3 times faster). Good luck!
Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
Ah sure, so we can't change what the threads are doing? If not, could you allocate the numbers to the thread in a non-sequential way? For example, could you say thread 1 has all the even numbers while thread 2 has all the odd numbers (which obviously would not be balanced correctly, it's just for an example)?
Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
If you're trying to find all of the prime numbers in a range, a much faster way to do it instead of checking each number individually for primality is to use a sieve. You start with a list of all of the numbers, and then go removing every even number, then every multiple of 3, etc. The numbers that are left are the prime numbers. If you need more information, see here. This method is a lot faster at finding all of the prime numbers in a certain range, which should remove the need for you to use multiple threads. The only issue is that you don't have access to an array, which makes it harder to use this method. You do mention that you use a "collection" for storing the final prime numbers, which you could use in the implementation of the sieve as well, but I would need more details if you need help with that.
Experienced Forum User, Published Author, Player (22)
Joined: 12/29/2020
Posts: 10
The easiest way to approach this is from the inside out. If x > 1, then by definition, floor(ceil(x)/x) < floor((x + 1)/x) = floor(1 + 1/x) = 1 (since 1/x < 1), and since ceil(x) >= x, it follows that floor(ceil(x)/x) = 1. Otherwise, if 0 < x <= 1, floor(ceil(x)/x) = floor(1/x) = n, where n is such that 1/(n + 1) < x <= 1/n. Now, for any integer b > 1, floor(logb(x)) = m, where m is such that bm <= x < bm + 1. Hence, floor(logb(floor(ceil(x)/x))) = 0 if x > 1/b, and for any integer k >= 1, floor(logb(floor(ceil(x)/x))) = k if 1/bk + 1 < x <= 1/bk. Now the integral S of this function between 0 and infinity becomes: S = sum from k = 1 to infinity of (k * (1/bk - 1/bk + 1)), S = sum of (k/bk - k/bk + 1). This is a telescoping sum, since the term -k/bk + 1 will (mostly) cancel with the (k+1)/bk + 1 term of the next term in the sum, leaving S = sum from k = 1 to infinity of 1/bk. This is a geometric series of ratio 1/b (which converges since b > 1), and so the sum is equal to S = (1/b)/(1 - 1/b) = 1/(b - 1).