Page 4 of 5 FirstFirst ... 2345 LastLast
Results 76 to 100 of 125

Thread: The League of Scripters

  1. #76
    Join Date
    Nov 2006
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Cheating as in, I do what you want me to do, but not the way you want me to do it

    Edit: 0.75 seconds now
    Edit2: 0.70 secs
    Infractions, reputation, reflection, the dark side of scripting, they are.

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

    Default

    *Hands over a SplitTPA from Wizplugin with his name splashed on it*
    I made a new script, check it out!.

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

    Default

    Problem 2 has been concluded! See bottom of first post for details and attachment for submitted scripts! If you didn't download the test image, but still wanted to see Raymond's in action, Killerdou has a string version in his you can mod into Ray's or convert back to an image, save and use that.

    Hoping to see more entrants for next weeks problem, so do come back soon!
    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.

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

    Default

    Damn, I assumed it ended tomorrow, a week after it was given...
    Meh, didn't really feel like working with TPAs anyways, and apparently neither did many other people

    EDIT: Waitwut Ray got ponits for
    SCAR Code:
    function raymonds_TPASplitter(tp: TPointArray; dist: Integer): array of TPointArray;
    begin
      Result := SplitTPA(tp,dist);
    end;
    ?? Didn't you say in the first post that you're allowed to use outside resources other than plugins?
    Last edited by bullzeye95; 10-02-2009 at 05:58 AM.

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

    Default

    huh?! i didnt even know we had new problems! You should really advertise their starting more. What was it, its not in the first post anymore.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  6. #81
    Join Date
    Nov 2006
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Infractions, reputation, reflection, the dark side of scripting, they are.

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

    Default

    Quote Originally Posted by bullzeye95 View Post
    Damn, I assumed it ended tomorrow, a week after it was given...
    Meh, didn't really feel like working with TPAs anyways, and apparently neither did many other people

    EDIT: Waitwut Ray got ponits for
    SCAR Code:
    function raymonds_TPASplitter(tp: TPointArray; dist: Integer): array of TPointArray;
    begin
      Result := SplitTPA(tp,dist);
    end;
    ?? Didn't you say in the first post that you're allowed to use outside resources other than plugins?
    http://pastebin.com/f6118c7d9
    Verrekte Koekwous

  8. #83
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    I think you should include the problem in a text file in the .rar file. Because I never got a chance to look at problem #2


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

    Default

    My bad regarding Ray's - since it was virtually just Ray until yesterday, I hadn't saved an up to date version.
    DanCardin, it's a weekly thing - of course there will be new problems often!
    Bobarkinator, I thought I had, my bad - basically the problem was just TPA into an ATPA with grouped points, as SplitTPA does.

    New problem coming up shortly!
    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.

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

    Default

    i dont check this thread unless it comes up with new posts, so it would greatly helpful if you could bump it with the newest problems in the post.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


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

    Default

    Lies, I can just make a post saying "There's a new problem!" and you can read that and see that it is most likely that I have uploaded a new problem.

    Anyway, there is a new problem! String sorting in 3 different ways with the option of case sensitivity or not. Check first post for details and post any queries here!
    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.

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

    Default

    is it just me or is alphabetizing abnormally difficult? i thought it would be easy, but now that i get to doing it, all my Method`s are rather convoluted.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


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

    Default

    With case insensitivity uppercase comes before lowercase, but is that just with the same word? For example:

    Hello
    Hug
    hello
    Zuperman

    or should the lower hello be under the upper Hello? I think as it is now would be correct?

    And you say characters like dots should have an equal value, but should there be looked further than that? For example:

    =zz
    .lol

    should lol come before zz?

    And just to be sure:

    HELLO

    comes before HELLO1?

    Oh, and how do you define a word? Is lol-o-matic one word?
    Last edited by nielsie95; 10-03-2009 at 04:41 PM.

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

    Default

    With case insensitivty, hello = HELLO. With case sensitivity, HELLO would come before hello. Hello, Hug, hello, Zebra would be the correct way to order them. With =zz and .lol, I meant that it should be thought as 0zz and 0lol, so you then go onto the next char, thus meaning that it would be .lol then =zz. Words are defined by spaces only. If they are follow by punctuation, then that punctuation is part of the word. Likewise, shorter words that start the same would be come before longer ones, ie "hello" and "hell" would be ordered to "hell", "hello". "The quick brown fox", "The quick brown fox jumped over the lazy dog" would be the correct order for those two.

    If there are any other questions, do ask
    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. #90
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    i personally am going to be giving an order to my non alphanumerics i hope thats alright.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


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

    Default

    Thanks for clarifying
    I entered.

    1,4ms for the given example (s := ['A', 'b', 'a', '.', '6', '5']).

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

    Default

    Quote Originally Posted by Dan Cardin View Post
    i personally am going to be giving an order to my non alphanumerics i hope thats alright.
    It's not really all right. There were two purposes to it:
    1) To stop people purely relying on ordinal values of chars
    2) It means that words can be better sorted in general - "hello world" and "hello-world" - which one, in common terms, would be classed first alphabetically? I would think of them as equal.
    In most cases though, it's just because things like "hey, how are you?" and "hey - how are you?" would be correctly ordered when relying upon ',' being equal to ' '.
    The only time it would really have any impact is when stuff like "hey, there" and "hey. there" comes up - which one should go first? Eek!
    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.

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

    Default

    well from all ive heard of alphabetizing, spaces go before anything. As for not having them ordered because of ordinal values, that really doesnt matter. 1 or 2 lines from the code in my head would be able to not have their order matter. but it seems to me that alphabetizing should have a static output as long as the actual strings remain the same, regardless of their order, but with not allowing them to have an order, the output will change depending on what comes where.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


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

    Default

    You still haven't told me which you think would logically come first - "," or ".". How about '&' and '@'? It's for the very reason that there are so many non-alphanumeric characters that don't really affect the string at all that I don't want them sorted by them.
    Also, it may only be 1 or 2 more lines of code, but it's still something else to test entries on

    I'll generally only be using strings that make use of spaces, quotation marks, inverted commas, hyphens, commas and periods (heh) though, so it's not that important. However, they will most likely be things like "Hey, how are you?" and "Hey. Having a good day?" - I would like them to be sorted based on alphanumeric characters rather than non ones.
    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.

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

    Default

    omgsh i totally forgot about this O:

    anyway im going to submit mine soon (:



    ~NS

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

    Default

    inverted commas? and what if they are the same? should it not matter? or are we to do them specifically in their origional order? (i keep acting like im entering, but if i dont find some time to actually write some stuff, i shant be able to ={)
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


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

    Default

    Well, it was basically just that if char x of string A is non-alphanumeric, where as char x of string B is, then string A comes before it. If they are both non-alphanumeric, then the next char is checked. If they are both alphanumeric, then they are compared to see alphabeticness
    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.

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

    Default

    Reminding everyone that all entries must be sent in in the next 24 hours or so!
    Only the one entry so far, so it's all to gain with any submission!

    Due to board going down for a bit, extending to Saturday 3pm GMT (22 hours from this edit) and will then post up next challenge at the same time as entry time closes.
    Last edited by mixster; 10-09-2009 at 04:15 PM.
    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.

  24. #99
    Join Date
    Apr 2006
    Location
    I live in NH
    Posts
    611
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Problem3 kindof.

    Code:
    // http://www.villavu.com/forum/showthread.php?t=50949
    {
     to do:
       - order the words from highest occ to lowest occ
       - if its the same occ then alphabetize the strings
       - number of occurrences of a string in a string
    }
    program HalfAssedProblem3ByRon;
    
    const
      strA = 'abcABD56.ask39DUIAS';
      strB = 'hello hello how are you? you are an asshole are are!';
    
    function str_alphabetize(str : String) : String;
    var
      str2 : String;
      i, n : Integer;
      arrDec : Array of Integer;
    begin
      n := length(str);
      SetArrayLength(arrDec, n);
      for i := 1 to n do
        arrDec[ i - 1 ] := ord(str[ i ]);
      BubbleSort(arrDec);
      for i := 0 to n - 1 do
        str2 := str2 + chr(arrDec[ i ]);
      Result := str2;
    end;
    
    // case sensitive
    function In2DArray( value : string; arr : T2DStringArray; twodindex : integer ) : integer;
    var
      i, n : integer;
    begin
      n := getarraylength(arr);
      result := -1;
      for i := 0 to n - 1 do
      begin
        if ( arr[ i ][ twodindex ] = value ) then
        begin
          result := i;
          break;
        end;
      end;
    end;
    
    function str_numOfOccurrences( str : String ) : T2DStringArray;
    var
      word : string;
      arr : T2DStringArray;
      n, posSpace, index : Integer;
      lastWord : Boolean;
    begin
      str := trim(str);
      posSpace := pos(' ', str);
      if ( posSpace = 0 ) then
      begin
        result := [str, '1'];
        exit;
      end;
      n := 0;
      while ( posSpace > 0 ) or ( lastWord ) do
      begin
        // grab str if last word since the rest of the str has been deleted
        if ( lastWord ) then
          word := str
        else // otherwise copy word from 0th place to position of space
             // delete word from string and grab next position
        begin
          word := copy(str, 0, posSpace - 1);
          delete(str, 1, posSpace);
          posSpace := pos(' ', str);
        end;
        // check if word is in array
        index := In2DArray( word, arr, 0 );
        WriteLn('Word: ' + word + ' | index = ' + IntToStr(index));
        // if word is in array then increment its count by 1
        if ( index > -1 ) then
        begin
          arr[ index ][ 1 ] := inttostr(strtoint(arr[ index ][ 1 ]) + 1);
        end else // if not, increase array length
        begin
          inc(n);
          setarraylength(arr, n);
          setarraylength(arr[ n - 1 ], 2);
          arr[ n - 1 ] := [word, '1'];
        end;
        // if the position of space ever equals zero, that means there is
        // 1 word remaining, flick lastword on and break out of loop
        if ( posSpace = 0 ) then
        begin
          if not( lastWord ) then
            lastWord := True
          else
            break;
        end;
      end;
      result := arr;
    end;
    
    var
      a : T2DStringArray;
      i, i2, n : integer;
    
    begin
      ClearDebug;
      WriteLn(str_alphabetize(strA));
      a := str_numOfOccurrences(strB);
      WriteLn('---');
      n := GetArrayLength(a);
      for i := 0 to n - 1 do
        WriteLn(a[ i ][ 0 ] + ' | ' + a[ i ][ 1 ])
    end.
    ~Ron
    DFM Form Parser - SCAR Obfuscator - Master Keylogger - RuneScape Stats Grabber - Index Cards

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

    Default

    Was I the only one to submit? Also, there's no new challenge?

    EDIT: Ah, hello Ron.
    Last edited by nielsie95; 10-10-2009 at 03:21 PM.

Page 4 of 5 FirstFirst ... 2345 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
  •