Mike is right.
I have to be out of the game because I didn't follow the rule to not look at the code.
Sorry Petr. I will try to make my best to be pardoned.
:-[
Sorry Roberto, I saw you were allowed to use the stat module. Ok, I hope I have a chance then. Have a nice vacation.
Mike is right.
I have to be out of the game because I didn't follow the rule to not look at the code.
Sorry Petr. I will try to make my best to be pardoned.
:-[
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Dooo, I was kidding Eros, of course you are allowed to compete further.
Hi,
no problem Eros,
purpose of this challenge is to have multiple samples of coding the same thing
Mike, I will test your version as soon as I'll get on thinBASIC powered PC, thanks !
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Hi Mike,
your code is very fast,
speed is very similar to Eros attempt,
although you use your own implementation of sort !
Just one tip to make your version even faster- instead of temporary variable use,
try to enter this in sort loop:
[code=thinbasic]
swap sa(i,1), sa(i+1,1)
swap sa(i,2), sa(i+1,2)
[/code]
Thanks,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Thanks Petr,
I was looking for something like this, but could not find it. That is why I did it this way.
But for sure, I will try this once I'm back.
Looking at the challenge code, that is neat how you guys all came up with different approaches!!
On my computer the results were as follows, I ran the tests twice to confirm:
1. Roberto an amazing 0 seconds on my computer
2. Petr at .036
3. Amazing but true a tie between Mike and Eros at .047
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Hi kryton,
it seems your PC is the only one which likes my code
Here are my results:
Roberto 0.03
Eros 0.179 <- sometimes this is Mikes time
Mike 0.189 <- sometimes this is Eros time
Me 1.22
Bye,
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Results on my machine:
Roberto 0.016
Eros 0.038
Mike 0.047
Petr 0.500
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
It seems a paper or help file will need to be written, for optimizing according to the CPU being used. Not really, but amazing the difference in the results.
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Bookmarks