RetroBASIC ReadOnly Archive
# 100000 Pray Pyth Tri using sbmeTW method.txt for Python very modified for timed tests 2016-01-22import timestart = time.time()a=6 ;b=5;c=1;s=5for p in range(100000): s=(a*b)-c c=b;b=s end = time.time()-startprint ccs = str(c)print len(cs), "digits"print end, "seconds"
I am starting to suspect your machine, is what? a 486 I would think Python would be at least be comparable in times to JB and more likely to be faster like Tomaaz results.
Hi Tomaaz, I tried to copy your 1000th PT to JB forum, I thought I broke my browser!
Also, the program comes from a year 2106. I'm pretty sure that folks there have much faster computers and they don't care that much about optimization.
Quote from: B+ on January 23, 2016, 12:21:14 AMI am starting to suspect your machine, is what? a 486 I would think Python would be at least be comparable in times to JB and more likely to be faster like Tomaaz results.Do you realize that this program is calculating 100000 numbers and the final one is more than 70000 digits long? That's pretty fast. Also, the program comes from a year 2106. I'm pretty sure that folks there have much faster computers and they don't care that much about optimization. Quote from: B+ on January 23, 2016, 12:21:14 AMHi Tomaaz, I tried to copy your 1000th PT to JB forum, I thought I broke my browser! Don't try to copy the 7000 digits long. It will destroy your machine probably. And the 70000 digits long may take down the whole Internet.
Yes, the year was typo, supposed to be 1206, the secret is out now.
Quote from: B+ on January 23, 2016, 05:29:05 PMYes, the year was typo, supposed to be 1206, the secret is out now. Wow! I knew BASIC was old, but 1206? BTW Fantastic backward compatibility!
Was the 77 sec thing straightened out...
a, b, c, s = 6, 5, 1, 5100.times {s = a * b - c; c, b = b, s; puts c}
function pytriple(n) a=BigInt(6) ;b=BigInt(5);c=BigInt(1);s=BigInt(5) for p = 1:n s=(a*b)-c c=b;b=s end print(c)end
void main() { int a, b, c, s, x; a = 6; b = 5; c = 1; s = 5; for(x = 0; x < 100; x++) { s = a * b - c; c = b; b = s; write("%d\n", c); } Stdio.Readline()->read();}