Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30

Thread: thinBASIC coding challenge #1

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

    Re: thinBASIC coding challenge #1

    WOW, Roberto put in the battle field one of his creature: STAT module !

    My version was 10 times faster than Petr one.
    Roberto version is 4 times faster than mine.

    Quite unbeatable!
    Attached Images Attached Images
    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

  2. #12

    Re: thinBASIC coding challenge #1

    does the sorting have to be done inside the timecounting or outside?

  3. #13

    Re: thinBASIC coding challenge #1

    Hello Mike,

    rules should be given before not after. :
    However you should absolutly make the sort inside the timecounting plus two clyce for next like me and Petr and optionally run a
    sleep 100
    
    statement! ;D

    Ciao,
    Roberto
    http://www.thinbasic.com

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

    Re: thinBASIC coding challenge #1

    Mike,

    sorry about Roberto comment ???
    He activated pre-vacation flag ;D

    To beat Roberto code the only way is:
    [code=thinbasic] dim t1, t2 as quad

    t1 = gettickcount
    '---Do nothing
    t2 = gettickcount
    msgbox 0, "Result of text analysis (" + STR$( (t2-t1)/1000, 3) + " seconds)", %MB_OK or %MB_ICONINFORMATION, "Results"
    [/code]

    ;D
    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

  5. #15

    Re: thinBASIC coding challenge #1

    Ops, excused me I have overstate I wanted to say SLEEP 10 instead of SLEEP 100.

    You can't belive but I found a tipical italian spaghetti code that bets my code although it executes a SLEEP 10 instruction.

    Here is the power code:
    [code=thinbasic]dim t1, t2 as quad
    dIM s AS STRING

    t1 = gettickcount
    s="5000 SPC"+$CRLF+"3000 e"+$CRLF+"2000 t"+$CRLF+"2000 o"+$CRLF+"2000 i"+$CRLF+"2000 h"+$CRLF+"1000 w"+$CRLF
    s=s+"1000 s"+$CRLF+"1000 r"+$CRLF+"1000 g"+$CRLF+"1000 NUL"+$CRLF+"1000 H"+$CRLF+"1000 ?"+$CRLF+"1000 ,"+$CRLF
    sleep 10
    t2 = gettickcount
    msgbox 0,"Result of text analysis (24000 bytes)"+$CRLF+$CRLF+s+$CR+$CR+"Operation took:"+STR$( (t2-t1)/1000, 3)+" seconds", %MB_OK or %MB_ICONINFORMATION, "Results"
    [/code]

    Good Easter to all,
    Roberto
    http://www.thinbasic.com

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

    Re: thinBASIC coding challenge #1

    Roberto,

    next time you will have so nice code to post, please obfuscate it so we will not see such a mess.
    Go holiday, please

    Ciao. See you next week.
    Eros
    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

  7. #17

    Re: thinBASIC coding challenge #1

    Apart the jokes, personally I have to thanks Petr because through the Coding Challenge it has given the occasion to me to show an example of thinbasic_stat.dll module and also understand that some new functionality should be usefull if added to the module. At least this until now because the challenge continue.

    Regards,
    Roberto
    http://www.thinbasic.com

  8. #18
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: thinBASIC coding challenge #1

    I guess we are allowed to look at the code now. I will study them this weekend as not sure what is going on quite with the challenge. But reading Eros's post about the speed increases in each of your examples, dramatic speed improvements.

    I am sure these challenges will be very entertaining and educating too, hoping for some time to look this weekend!!
    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

  9. #19
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: thinBASIC coding challenge #1

    Hi,

    Eros, Roberto ... what did you do to me
    Very fast codes, as usual I forgot thinBASIC pointer magic and STAT module!


    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

  10. #20

    Re: thinBASIC coding challenge #1

    Petr, I think Eros and Roberto are disqualified ;D Eros looked at Roberto's code before friday the 13th and Roberto used the power of modules ;D

    But I forgive them both, my mind is on vacation mode too.

    So it is only between Petr and me, he he. But only if Kent won't participate.

    Here is my entry. Not sure how fast it is.

    Michael
    Attached Files Attached Files

Page 2 of 3 FirstFirst 123 LastLast

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
  •