Page 2 of 5 FirstFirst 1234 ... LastLast
Results 26 to 50 of 125

Thread: The League of Scripters

  1. #26
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by senrath View Post
    Probably. There really aren't all that many ways to go about these two problems.
    Exactly, there is only a little amount of algorithm research google can turn up, so most are probably similar.
    Jus' Lurkin'

  2. #27
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I used a bit of Sieve of Eratosthenes and Sieve of Atkin algorithim in the most simplest form I could get it in :P Those two seem to be the most common. I was thinking of using the Wilson's Theorem but found out its only for Wilson Prime numbers...

    Are we allowed to re-submit? I might add and tune a bit more since everyone is getting similar results.



    ~NS

  3. #28
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    We never learned about primes (yet), so I just brew something up using the Wikipedia description (I guess it's the Sieve of Eratosthenes).

  4. #29
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    I just applied a naive primality test to each number from 3 to n (1000 in this case).

  5. #30
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    I was hoping for more advanced scripting :/
    Like "Make a script that will fill the gaps between the lines in this pic: http://img16.imageshack.us/img16/1754/asdfasdfo.png "

  6. #31
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    I was hoping for more advanced scripting :/
    Like "Make a script that will fill the gaps between the lines in this pic: http://img16.imageshack.us/img16/1754/asdfasdfo.png "
    SCAR Code:
    var
      x, y: Integer;
    begin
      for x := 29 to 621 do
        for y := 87 to 735 do
          if(GetColor(x, y) = 16777215)then
            ClickMouse(x, y, True);
    end.

  7. #32
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by ian. View Post
    SCAR Code:
    var
      x, y: Integer;
    begin
      for x := 29 to 621 do
        for y := 87 to 735 do
          if(GetColor(x, y) = 16777215)then
            ClickMouse(x, y, True);
    end.
    that would change the color clWhite to black, not to fill the gaps...

  8. #33
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    I was hoping for more advanced scripting :/
    Like "Make a script that will fill the gaps between the lines in this pic: http://img16.imageshack.us/img16/1754/asdfasdfo.png "
    You tried either of them yet? And made it fast, ie, under 50ms?
    Jus' Lurkin'

  9. #34
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    that would change the color clWhite to black, not to fill the gaps...
    It would fill the gaps quite well. It would just do other things as well.

  10. #35
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    that would change the color clWhite to black, not to fill the gaps...
    Well I would say that all the white is a gap.. so if you run that in paint/gimp/ps (with correct coords) it will turn it all black..

  11. #36
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by Torrent of Flame View Post
    You tried either of them yet? And made it fast, ie, under 50ms?
    Yes, already did that. Not for this competition, and it was a long time ago so I do not have the script anymore.

  12. #37
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Do the algorithms need to be able to accept any number (up to the maximum number an integer can hold of course), or can they be optimized to the numbers you are giving us? For example, you have said that there are 7 prime factors for 1578833364. Are we allowed to set the length of the array that holds these numbers to 7, or must we make the function/script able to find the factors of numbers that have more than 7 factors?

  13. #38
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Torrent of Flame View Post
    Dan Cardin, huh? Mine flickers between 16-40ms randomly. It isnt a constant time.
    mine is 31 ms always. This contest would be better if one wasnt supposed to look stuff up. My entry before i did was crap, but it was better because it used only my own knowledge.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  14. #39
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Lots of stuff to reply to, fun times!

    Quote Originally Posted by bullzeye95 View Post
    Do the algorithms need to be able to accept any number (up to the maximum number an integer can hold of course), or can they be optimized to the numbers you are giving us? For example, you have said that there are 7 prime factors for 1578833364. Are we allowed to set the length of the array that holds these numbers to 7, or must we make the function/script able to find the factors of numbers that have more than 7 factors?
    As I didn't define it and entries have done both, I would say it can be tailored to this specific problem, but preferred to not be. It was a bit of a miss on my part and I'll try to make sure it doesn't happen again. Either way though, it shouldn't overly affect the end time too much, so it's up to you.

    Quote Originally Posted by Zyt3x View Post
    I was hoping for more advanced scripting :/
    Like "Make a script that will fill the gaps between the lines in this pic: http://img16.imageshack.us/img16/1754/asdfasdfo.png "
    This was really just a starter one to see how many people would actually enter. An easy to do, hard to do well problem is perfect as most people can have a go and succeed, but those with the know-how can do it oh so much better than those who do not.

    Quote Originally Posted by Dan Cardin View Post
    mine is 31 ms always. This contest would be better if one wasnt supposed to look stuff up. My entry before i did was crap, but it was better because it used only my own knowledge.
    Quote Originally Posted by Torrent of Flame View Post
    Exactly, there is only a little amount of algorithm research google can turn up, so most are probably similar.
    Quote Originally Posted by senrath View Post
    Probably. There really aren't all that many ways to go about these two problems.
    It takes real skill to take the same code and make it more efficient, which is pretty useful when it comes to scripting. It's all well and good finding an algorithm online and converting it into Scar, but knowing the little tweaks that take a bit of time from here and there really shows.

    Quote Originally Posted by Torrent of Flame View Post
    Mine flickers between 16-40ms randomly. It isnt a constant time.
    I can tell you that it just about always flickers between values, but I run them multiple times then get the most common quick time, which will usually emerge from being run 5 times. If you have very little open, including system stuff, then you should end up getting pretty constant times, but it of course also depends on what you are using to time it (I'm using Nielsie's timing stuff that relate to API calls from a while back).
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  15. #40
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by mixster View Post
    It takes real skill to take the same code and make it more efficient, which is pretty useful when it comes to scripting. It's all well and good finding an algorithm online and converting it into Scar, but knowing the little tweaks that take a bit of time from here and there really shows.
    still silly.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  16. #41
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    b..b..b..but i did make it more efficient, it was like running at 100ms when I reserached it :<
    Jus' Lurkin'

  17. #42
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    100ms??
    I can do both challenges in around 7ms O.o
    Last edited by Markus; 09-24-2009 at 01:41 AM.
    I made a new script, check it out!.

  18. #43
    Join Date
    Mar 2007
    Location
    Players[-1].Loc
    Posts
    962
    Mentioned
    4 Post(s)
    Quoted
    5 Post(s)

    Default

    7ms? I can't get mine past 14 =\

  19. #44
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Depends on the computer ofcourse.
    My "lower" submission gets me 6.7ms (started at 14.5ms but managed to get it a lot down), and the "upper" 7.15ms (haven't spent much time optimising it though).
    I made a new script, check it out!.

  20. #45
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    Depends on the computer ofcourse.
    My "lower" submission gets me 6.7ms (started at 14.5ms but managed to get it a lot down), and the "upper" 7.15ms (haven't spent much time optimising it though).
    It started at 100ms and it averages like 25ms now. Also Markus, do remember you're a pro scripter.
    Jus' Lurkin'

  21. #46
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Announcing the entry deadline as 3pm GMT tomorrow (18 hours time as of this post). If it's not in by then, then it is not to be run for the final testing time. I am having a bit of laptop trouble, but as long as you PM'ed me the entry I'll be able to access and so time it accurately.

    So, as the deadline is early afternoon tomorrow, the results will be up later in the afternoon and the next problem will be up day after tomorrow! You can expect a large increase in difficulty, but also what many will view as a better test of scripting ability (hopefully).
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  22. #47
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by mixster View Post
    This was really just a starter one to see how many people would actually enter. An easy to do, hard to do well problem is perfect as most people can have a go and succeed, but those with the know-how can do it oh so much better than those who do not.
    Ah, thank you for explaining that to me

  23. #48
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mixster View Post
    Announcing the entry deadline as 3pm GMT tomorrow (18 hours time as of this post). If it's not in by then, then it is not to be run for the final testing time. I am having a bit of laptop trouble, but as long as you PM'ed me the entry I'll be able to access and so time it accurately.

    So, as the deadline is early afternoon tomorrow, the results will be up later in the afternoon and the next problem will be up day after tomorrow! You can expect a large increase in difficulty, but also what many will view as a better test of scripting ability (hopefully).
    Better be so
    Verrekte Koekwous

  24. #49
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    increase in difficulty isnt necessarily necessary. Just something that takes a lot more thinking with more ways to do it. I guess thats still kind of describing more difficulty, but i would rather have something thats very doable by most people that just takes a lot of bit of thinking/good scripting to not suck rather than something that is just technically difficult which would limit the number of ways to accomplish it usually.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  25. #50
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, mine is getting roughly 210 milliseconds, and it's missing the first ten-ninety primes (depending on what you put in) .

    Edit:

    Aha! Forgot a + 1, finds all the primes now, but still takes 210 milliseconds xD.

    Edit2:

    Fastest time is 146 milliseconds now . Averaging 165-170.

    ~Sandstorm
    Last edited by Sandstorm; 09-24-2009 at 06:46 AM.

Page 2 of 5 FirstFirst 1234 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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