Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30

Thread: thinBASIC coding challenge #1

  1. #21
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

    Re: thinBASIC coding challenge #1

    Sorry Roberto, I saw you were allowed to use the stat module. Ok, I hope I have a chance then. Have a nice vacation.

  2. #22
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: thinBASIC coding challenge #1

    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

  3. #23
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

    Re: thinBASIC coding challenge #1

    Dooo, I was kidding Eros, of course you are allowed to compete further.

  4. #24
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: thinBASIC coding challenge #1

    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

  5. #25
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: thinBASIC coding challenge #1

    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

  6. #26
    thinBasic MVPs Michael Hartlef's Avatar
    Join Date
    Sep 2006
    Location
    Germany
    Age
    58
    Posts
    3,299
    Rep Power
    348

    Re: thinBASIC coding challenge #1

    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.

  7. #27
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    405

    Re: thinBASIC coding challenge #1

    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

  8. #28
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: thinBASIC coding challenge #1

    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

  9. #29
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: thinBASIC coding challenge #1

    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

  10. #30
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    405

    Re: thinBASIC coding challenge #1

    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

Page 3 of 3 FirstFirst 123

Similar Threads

  1. tbgl coding challenge
    By kryton9 in forum TBGL General
    Replies: 4
    Last Post: 10-06-2007, 21:42

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •