Right, but the average length of a calculation wouldn't nearly be the heat death of the universe. To generate a ten digit number. Especially if any two or more digits are the same.
Search:
Type: Posts; User: GAMEchief
Search: Search took 0.02 seconds.
- 24 Mar. 2013, 11:43pm
Thread: My retarded idea
by GAMEchief- Replies
- 26
- Views
- 1,206
Right, but the average length of a calculation...
- 22 Mar. 2013, 01:33am
Thread: My retarded idea
by GAMEchief- Replies
- 26
- Views
- 1,206
That again depends on the length of the array...
That again depends on the length of the array being sorted, and as stated, even pure randomness has a limit to how many iterations it would take. 1 in 3 million would not take until the heat death of...
- 21 Mar. 2013, 11:08pm
Thread: My retarded idea
by GAMEchief- Replies
- 26
- Views
- 1,206
Tries it does a second? Why not just time how...
Tries it does a second?
Why not just time how long it takes to complete...?
startTime = currentTimeWithMilliseconds();
doSort();
endTime = currentTimeWithMilliseconds();
total = endTime -... - 21 Mar. 2013, 04:53pm
Thread: My retarded idea
by GAMEchief- Replies
- 26
- Views
- 1,206
You're a little off. Since the first number is...
You're a little off.
Since the first number is correct (1/10 chance), then the second number has a 1/9 chance of being correct (since the first number is no longer in the pool of numbers). And the... - 19 Mar. 2013, 04:32pm
Thread: My retarded idea
by GAMEchief- Replies
- 26
- Views
- 1,206
What? Are you trying to randomly generate an...
What?
Are you trying to randomly generate an array [1, 2, 3, 4, ...]? - 19 Mar. 2013, 04:01pm
Thread: My retarded idea
by GAMEchief- Replies
- 26
- Views
- 1,206
I was surprised it worked. Second try, because I...
I was surprised it worked. Second try, because I forgot a.length gets reparsed each loop, so I had to define it as e.
It was also surprisingly fast, but I guess I always forget to give JavaScript... - 19 Mar. 2013, 04:00am
Thread: My retarded idea
by GAMEchief- Replies
- 26
- Views
- 1,206
var a = [5, 4, 3, 2, 1], sort = function(a) ...
var a = [5, 4, 3, 2, 1],
sort = function(a)
{
var e = a.length;
for (var x = 0; x < e - 1; x++)
{
if (a[x] > a[x + 1])
{
var n = [];
for (var y =...
Results 1 to 7 of 7