Page 1 of 4 123 ... LastLast
Results 1 to 25 of 93

Thread: Project Sigma!

  1. #1
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,611
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default Project Sigma!

    Projσct Σ
    by Daniel


    Notice for those who can't/refuse to read: Do NOT post your solutions, PM Me!



    Introduction:
    Welcome to Project Sigma! This is along the lines of Project Euler (for those that know of it), but is more oriented to this community of beginner scripters utilising Simba. Don’t be fooled though, as it is designed for every one of all levels! Problems to solve will be released on a weekly basis, with user submissions submitted to me (via the PM system here at SRL/Villavu ONLY). Points are awarded to those whose code executes the fastest on my machine.
    Rules:
    1. Problems are to be solved using Simba.
    i. This includes, but is not limited to, compiled code in the form of external libraries.
    ii. Code must be able to compile using the Lape interpreter.
    iii. Code cannot be submitted precompiled.
    2. Problems must be solved independently.
    i. This excludes using the assistance of the Internet to find the pseudo code of a required algorithm.
    ii. This applies to You, the coder, directly or indirectly asking for assistance for a given problem (i.e. using IRC, another medium such as StackOverflow or programming-oriented forums).
    3. The main, “problem-solving” part of the solution must be your code/creation.
    i. e.g., if the problem asks to find the sum of an integer array, you cannot utilise Simba’s included method SumIntegerArray.
    4. Solutions must be submitted before or on the due date. Late submissions will forfeit your chance to increment your position on the leader board.
    i. If a person submits two or more solutions, then the earliest submitted will only be used – so test and ensure before submitting!
    ii. If a person submits two or more solutions to multiple levels, then their highest level submission will only be used for grading.
    iii. SRL Members (both past and present) and higher ranked (also, both past and present) are not allowed to compete in the beginner level.
    5. Solutions are submitted under a public domain license.
    i. This includes the later publication of your solutions for others to learn off of.
    ii. By submitting, you agree to allow unrestricted use of your code in other peoples projects, utilising Simba/SRL or otherwise.
    6. Use common sense, keep this competition/learning experience clean and fun
    Marking Criteria (How you are judged):
    If your submission does not meet the required outcomes of the problem, then it will not be graded as per below.

    What determines your resultant score is [mainly] based solely on the speed of your submission. Textual outputs (i.e. WriteLn) will not be counted when determining the speed of your submission if they are independent of your problem. A maximum of five (if not otherwise stated) tests will be conducted and run through multiple iterations to determine your speed. The maximum speed attained, will be the speed that is used to determine your score.

    If two or more solutions achieve the same result, then all of these solutions will be stress tested for a maximum of 10
    × iterations with a much wider variety of parameters used. The winner of this stage will be awarded an additional 5, 3, or 1 point (with respect to their level – Advanced, Intermediate or Beginner).

    If two or more solutions once again receive the same speed result, then their solutions performance will be tested using more accurate timing methods using the same test parameters as the previous paragraph. The winner of this stage will be awarded with an additional 7, 5, or 3 points (also, with respect to their level).

    If once again, two or more solutions receive the same result, then the amount of raw code that is theirs used to complete the problem will be used to grade the result, with efficiency (CPU usage and memory usage) taken into account. The winner of this stage will be awarded 12, 9 or 6 points with respect to their level. If the solutions examined tie once again, then all entrants will be awarded with 10, 7 or 4 extra points with respect to their level.
    Leaderboard:

    Overall:

    1. mixster - 20
    2. Dgby714 - 10
    3. Methrend - 10
    4. beginner5 - 5
    5. slushpuppy - 5
    6. Sex - 2
    7. Zyt3x - 2
    8. putonajonny - 2
    9. masterBB - 2
    10. -


    Advanced:

    1. mixster - 20
    2. beginner5 - 5
    3. -
    4. -
    5. -
    6. -
    7. -
    8. -
    9. -
    10. -


    Intermediate:

    1. Dgby714 - 10
    2. Methrend - 10
    3. Sex - 2
    4. Zyt3x - 2
    5. putonajonny - 2
    6. masterBB - 2
    7. -
    8. -
    9. -
    10. -


    Beginner:

    1. slushpuppy - 5
    2. -
    3. -
    4. -
    5. -
    6. -
    7. -
    8. -
    9. -
    10. -
    Problem #3:

    Beginner:
    Binary What?
    You are to construct a program which converts X (of type unsigned Integer [that means no negative values will be given]) into its binary equivalent. You are not allowed to use any in-built Simba methods to assist with this conversion. Make sure X is a defined constant that is placed at the beginning of your script and is more suitably named given its purpose.
    NOTE: You are not required to pad your output.


    Example:
    X = 2
    Output = 10


    Example:

    X = 10
    Output = 1010


    Example:

    X = 15
    Output = 1111
    Points Awarded: 5
    Intermediate:
    Fun With Factorials #2!
    Write a program that finds the amount of trailing zeroes of the factorial X. You are not allowed to use the in-built Simba method Factorial to calculate the factorial of a number (you must make your own!). Make sure X is a defined constant that is placed at the beginning of your script and is more suitably named given their purpose.

    Example #1:

    X = 5
    Factorial = 120
    Output = 1


    Example #2:

    X = 3
    Factorial = 6
    Output = 0

    Points Awarded: 10
    Advanced:
    Big-Super-Large Numbers!
    You are to write a library for Simba in the form of an include file which enables support for integers larger than length 20 ( Length[IntToStr(2^64)] ). You must support the four basic mathematical operations (addition, subtraction, multiplication and division), as-well as y-√ (i.e. Sqrt[y](x) ) in separate functions with the result type as your big number type, as-well as including a method to convert a big number to and from a standard integer with overflow checking, and to and from a string.


    NOTE #1: You are not expected to have support for floating point numbers in your solution.


    Example:

    BigNumAdd(100, 100) = 200 // Addition
    BigNumSub(50, 100) = -50 // Subtraction
    BigNumMultiply(2, 50) = 100 // Multiplication
    BigNumDiv(50, 2) = 25 // Division
    BigNumSqrt(25, 2) [==Sqrt(25)] = 5 // Square root
    BigNumSqrt(1000, 3) [== y-root(1000, 3)] = 10 // Cube root
    BigNumToStr(24) = ‘24’
    BigNumToInt(1) = 1

    Points Awarded: 20
    Submission Date:
    To be submitted by:
    Sunday 25th of March, 2012, 12:00 PM (AEDT / GMT + 11)
    OR, Sunday 25th of March, 2012, 01:00 AM (GMT)
    OR, Saturday 24th of March, 2012, 5:00 PM (PST / GMT - 8)
    Good Luck, and don't rush!
    Last edited by Daniel; 03-17-2012 at 11:33 PM. Reason: Added "don't rush" to conclusion of post. Indented submission dates.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  2. #2
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,611
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Past Questions:

    Week #2:

    Please see this post for user submissions.


    Beginner:
    Fun With Factorials!
    Write a program that programmatically finds the Highest Common Factor of the factorial X and the factorial of Y, otherwise return 0 (zero). Make sure X and Y are defined constants that are placed at the beginning of your script and are more suitably named given their purpose.


    Example:
    X = 5, Y = 6
    HCF = 120
    There were no valid submissions for this entry. Quite disappointing
    Intermediate:
    ReadInts:
    Write a program that clones the IntToStr function within Simba. In your solution, you may NOT use Simba’s *ToStr in any way (including Format or any other variant), shape or form, and you must check the validity of the argument given. You must also support integers that are both positive AND negative, and output accordingly.

    Example #1:

    Input = 1000
    Output = "1000"


    Example #2:

    Input = -500
    Output = "-500"


    Example #3:

    Input = "abc"
    Output = ""
    There were three entries for this. Dgby714's submission, however, was the fastest out of all three. [Nathan]'s I couldn't really accept because it didn't work for most of the values tested (48% success rate).

    Advanced:
    PolyCom
    Write a program that takes a standard array of points of n-length, which constructs a 2-dimensional polygon shape (arr1 connects to arr2 , arr2 -> arr3 , … , arrn-1 -> arrn , arrn -> arr1)note-1. Create separate appropriately-named methods which:

    • returns TRUE if the argument point (of type TPoint) is inside the polygon,
    • returns TRUE if the polygon is complex,
    • returns the amount of closed regions of the polygon,
    • returns the maximum angle in DEGREES (minimum precision of 3 floating point numbers) of ALL intersections IF the polygon is complex. You are to sort this array so that it is ordered in a top-down, left-right order.note-2

    NOTE #1: You must connect the provided points to each other via straight lines, these will not be given.
    NOTE #2: An intersection is defined if TWO lines intersect and continue past that point.


    Example #1:
    array = [(0, 0), (5,5), (5, 0)]
    Result_PointInside(2, 1) = True
    Result_IsComplex = False
    Result_RegionCount = 1
    Result_Angles = [ [] ]

    Example #2:
    array = [(0, 0), (5, 0), (0, 5), (5, 5)]
    Result_PointInside(6, 1) = False
    Result_IsComplex = True
    Result_RegionCount = 2
    Result_Angles = [ x.xxx ]
    No submissions for this which was quite saddening Dgby714, however, allowed me to show to the public his unfinished submission (which only works for simple polygon's). Quite impressive

    No points were awarded.

    Week #1:

    Please see this post for user submissions.


    Beginner:
    Find-A-Number! -
    Write a program that finds the position of the first occurrence of X in a sorted array of whole numbers. Make sure that X is a defined constant at the beginning of your script and is more appropriately named for its purpose.

    Example:
    X = 3, Array = [1, 2, 3, 4, 5]
    Result = 3

    Since there was only one entry (disappointing!), there was only one winner: slushpuppy.

    Intermediate:
    Brute Force Madness -
    Write a program that returns all possible combinations of the characters in string, in order of the sequence of characters with no overlaps. Make sure that string is a constant and is placed at the beginning of the script.

    Example:
    string = ‘abc’
    Result = ‘aaa’, ‘aab’, ‘aac’ … ‘ccc’
    [I]There were several entries, which was quite impressive Methrend's was the fastest out of the quad entrants.

    Advanced:
    Sort n’ Search -
    You will be given an n-length array of random integer values with a signed 24-bit range. You are required to sort this array first following a pattern/sequence (i.e. ascending-descending, descending-ascending, odd-even, even-odd, etc - no "intelligent design sort"), not using the internal sorting methods already included Simba, or implementing a Quick Sort or Bubble Sort algorithm. You are then required to return the positions of all occurrences of X and Y in that sorted array. You should return an integer array of these positions in two separate appropriately named arrays. Make sure that X, Y and array are defined constants at the beginning of your script, and are more appropriately named given their purpose.
    Example:
    X = 6, Y = 9, Array = [4, 9, 4, 3, 9]
    ResultX = [], ResultY = [4, 5]

    Only two entries: mixster and beginner5 Unfortunately beginner5 used BubbleSort, but I still allowed it anyway because of the limited number of entrants. mixster had won this week in terms of speed.
    Last edited by Daniel; 03-17-2012 at 02:34 AM.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  3. #3
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,611
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Reserved in case the first two threads fill up.
    Last edited by Daniel; 03-02-2012 at 12:24 PM.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  4. #4
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,034
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    lol... Apparently I can't read...
    Last edited by Dgby714; 03-02-2012 at 12:27 PM.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  5. #5
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,283
    Mentioned
    105 Post(s)
    Quoted
    489 Post(s)

    Default

    You might want to specify that submitting is done through PM? At least that is what I believe is the correct way.

  6. #6
    Join Date
    Oct 2011
    Posts
    804
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    ii. Code must be able to compile using the Lape interpreter.
    Why Lape not PS?

  7. #7
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,611
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by beginner5 View Post
    Why Lape not PS?
    Wider platform support, faster compilation time, pointer support, etc

    The code is exactly the same as what you would write in PascalScript, so it shouldn't be a problem at all

    Plus, it will also get the community to start adopting Lape in favour of PascalScript, as-well as a great testing ground for Niels
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  8. #8
    Join Date
    Sep 2006
    Posts
    6,093
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Sounds great!
    Hup Holland Hup!

  9. #9
    Join Date
    Oct 2011
    Posts
    804
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Plus, it will also get the community to start adopting Lape in favour of PascalScript, as-well as a great testing ground for Niels
    But with Lape in Simba ...hmm I can't even compile this:
    Simba Code:
    program new;
    {$i SRL/SRL.simba}
    begin
    end.
    So it's really hard to adopt Lape:P

  10. #10
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,568
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Awesome, been lazy about using Lape, this will get me to finally play with it!
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  11. #11
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,034
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Quote Originally Posted by beginner5 View Post
    But with Lape in Simba ...hmm I can't even compile this:
    Simba Code:
    program new;
    {$i SRL/SRL.simba}
    begin
    end.
    So it's really hard to adopt Lape:P
    You should prob check out the Lape branch for SRL >..>

    Anyways yes Lape is missing a few things to make it "Public".
    Tho people should still start to learn the extra things it has.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  12. #12
    Join Date
    Feb 2006
    Location
    Berkeley, CA
    Posts
    1,839
    Mentioned
    52 Post(s)
    Quoted
    60 Post(s)

    Default

    Submitted my solution to the advanced problem. +1 internets to anyone that beats me.

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

    Default

    I've sent in my script and it shall be great wins!
    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.

  14. #14
    Join Date
    Feb 2006
    Location
    Berkeley, CA
    Posts
    1,839
    Mentioned
    52 Post(s)
    Quoted
    60 Post(s)

    Default

    I still think my solution is valid under the rewrite, but that is up to herr judge.

  15. #15
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,611
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    I only have submissions for the advanced thus far. Nobody wanting to do the other levels?
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  16. #16
    Join Date
    Dec 2011
    Posts
    258
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Daniel View Post
    I only have submissions for the advanced thus far. Nobody wanting to do the other levels?
    I might have a go at the beginner, what program do you want the answer to appear in?

  17. #17
    Join Date
    Feb 2007
    Location
    Switzerland
    Posts
    582
    Mentioned
    1 Post(s)
    Quoted
    50 Post(s)

    Default

    @Daniel
    I am trying to do BruteForceMadness at the moment.

  18. #18
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,283
    Mentioned
    105 Post(s)
    Quoted
    489 Post(s)

    Default

    Quote Originally Posted by Gala View Post
    @Daniel
    I am trying to do BruteForceMadness at the moment.
    Then from now on we are rivals. I submitted my solution.

  19. #19
    Join Date
    Feb 2007
    Location
    Switzerland
    Posts
    582
    Mentioned
    1 Post(s)
    Quoted
    50 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    Then from now on we are rivals. I submitted my solution.
    I am still struggling with my script, I will try to finish it tomorrow.

  20. #20
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,611
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by sm321 View Post
    I might have a go at the beginner, what program do you want the answer to appear in?
    You are to program in Simba, and display your findings in the debug/output box below.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  21. #21
    Join Date
    Dec 2011
    Posts
    258
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Beginner:
    Find-A-Number! -
    Write a program that finds the position of the first occurrence of X in a sorted array of whole numbers. Make sure that X is a defined constant at the beginning of your script and is more appropriately named for its purpose.

    Example:
    Code:
    X = 3, Array = [1, 2, 3, 4, 5]
    Result = 3
    I don't get what you mean by "position of the first occurrence of X". It's written clearly but I'm new to this

  22. #22
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,283
    Mentioned
    105 Post(s)
    Quoted
    489 Post(s)

    Default

    A few extra examples:

    X = 6, Array = [1, 3, 6, 8]
    Result = 3

    X = 2, Array = [2, 2, 7, 11, 14]
    Result = 1

    X = 11, Array = [2, 7, 7, 11, 11]
    Result = 4

  23. #23
    Join Date
    Dec 2011
    Posts
    258
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    A few extra examples:

    X = 6, Array = [1, 3, 6, 8]
    Result = 3

    X = 2, Array = [2, 2, 7, 11, 14]
    Result = 1

    X = 11, Array = [2, 7, 7, 11, 11]
    Result = 4
    Sorry, still no idea. Once you have X, then what. I know things like:

    Code:
    x+4=6
    x=2

  24. #24
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,568
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Are you basing the index number from 1 or 0? Technically, your examples should read 1 less, since arrays start with 0.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  25. #25
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    87
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by sm321 View Post
    Sorry, still no idea. Once you have X, then what. I know things like:

    Code:
    x+4=6
    x=2
    Quote Originally Posted by masterBB View Post
    A few extra examples:

    X = 6, Array = [1, 3, 6, 8]
    Result = 3

    X = 2, Array = [2, 2, 7, 11, 14]
    Result = 1

    X = 11, Array = [2, 7, 7, 11, 11]
    Result = 4
    What he is trying to tell you is that you must find the first occurrence of "x". A.K.A "At which point you first notice x".

    In example 1, x=6. Therefore you look at the numbers and note which point the value for x first occurs.



    [1 (first number), 3 (second number), 6(third number), 8(fifth number)]



    As you can see, the result is 3. You are not trying to solve what x itself equals, rather what position x has in a list of numbers.



    P.S I may be wrong, but that's how I see it.
    Last edited by Sytherix; 03-05-2012 at 09:20 AM.
    ----------------
    Giving up isn't an option, it is a failure.

Page 1 of 4 123 ... 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
  •