Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Next coding challenge

Next coding challenge

Scheduled Pinned Locked Moved The Lounge
questiondiscussion
36 Posts 17 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Chris Maunder

    Friday's coming up. Any thoughts on our next coding challenge? We need a simple task, easily coded, and easily tested.

    cheers Chris Maunder

    Kornfeld Eliyahu PeterK Offline
    Kornfeld Eliyahu PeterK Offline
    Kornfeld Eliyahu Peter
    wrote on last edited by
    #21

    It maybe too easy, but in honor of the ongoing Chess Word Championship (for humans and for chess engines) we may do the 8 queen problem...

    Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

    "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

    P 1 Reply Last reply
    0
    • J Jon McKee

      A Collatz generator could be interesting since there are optimizations available but the Josephus problem already has an extremely simple solution using binary. I doubt it would yield any interesting programs except maybe the language used. Not a fan of the app since that specifically targets only people that use both AngularJS and NodeJS. Just my 2 cents :)

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #22

      Jon McKee wrote:

      Not a fan of the app since that specifically targets only people that use both AngularJS and NodeJS.

      I was just being smart here to get my work done. ;P

      "It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]

      1 Reply Last reply
      0
      • C Chris Maunder

        Friday's coming up. Any thoughts on our next coding challenge? We need a simple task, easily coded, and easily tested.

        cheers Chris Maunder

        K Offline
        K Offline
        Kirill Illenseer
        wrote on last edited by
        #23

        Drawing Lissajous curves with (pseudo)random variying frequencies for X and Y in away that the resulting line remains uninterrupted.

        1 Reply Last reply
        0
        • C Chris Maunder

          Friday's coming up. Any thoughts on our next coding challenge? We need a simple task, easily coded, and easily tested.

          cheers Chris Maunder

          M Offline
          M Offline
          Mark_Wallace
          wrote on last edited by
          #24

          How about "Do something to make my life* easier"? * Mine, that is.

          I wanna be a eunuchs developer! Pass me a bread knife!

          K 1 Reply Last reply
          0
          • C Chris Maunder

            Friday's coming up. Any thoughts on our next coding challenge? We need a simple task, easily coded, and easily tested.

            cheers Chris Maunder

            K Offline
            K Offline
            kalberts
            wrote on last edited by
            #25

            When we were students, a long, long time ago, one of my fellow students realized that he didn't master recursion very well - termination conditions in particular. So he defined a simple programming challenge for himself: The program should draw a vertical zigzag line of asterisks on the printer (this was in the age of line printers): A count of spaces reflecting the recursion depth, with a "*" at the end. Each function call creates one such line, nothing else. Now, at the top, "main()" level, he would call the recursive function with an argument MaxRecursionDepth to which the recursion should go directly when started (creating a slanted line of asterisks), an argumment IntermediateRecursionDepth to which the recursion should unroll (continuing the line, slanting the other way, but not all the way back). Then, it should recurse deeper again to MaxRecursionDepth and unroll to IntermediateRecursionDepth, reapeated as many times as indicated by the third agument, NumberOfPeaks, before unrolling to complete the program. The printout should look like a tipped-over contour of a row of mountain peaks separated by valleys, the peak height, number of peaks and valley depths given by the three arguments. If you have been writing recursive functions every day the last ten years, this is quite trivial. But if you are a student who heard the term 'recursion' for the first time last week, it takes some fiddeling to get those termination tests (and re-recursing tests) right. And then, when you see the working solution, you won't understand why it took that much effort to get it correct :-)

            P 1 Reply Last reply
            0
            • Kornfeld Eliyahu PeterK Kornfeld Eliyahu Peter

              It maybe too easy, but in honor of the ongoing Chess Word Championship (for humans and for chess engines) we may do the 8 queen problem...

              Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

              P Offline
              P Offline
              PIEBALDconsult
              wrote on last edited by
              #26

              I did N-Queens a few years back, but not the ability to determine which solutions are distinct/unique. So include the above suggestion of rotating an NxN matrix, add flipping of the matrix, and then you've got something. :cool:

              1 Reply Last reply
              0
              • K kalberts

                When we were students, a long, long time ago, one of my fellow students realized that he didn't master recursion very well - termination conditions in particular. So he defined a simple programming challenge for himself: The program should draw a vertical zigzag line of asterisks on the printer (this was in the age of line printers): A count of spaces reflecting the recursion depth, with a "*" at the end. Each function call creates one such line, nothing else. Now, at the top, "main()" level, he would call the recursive function with an argument MaxRecursionDepth to which the recursion should go directly when started (creating a slanted line of asterisks), an argumment IntermediateRecursionDepth to which the recursion should unroll (continuing the line, slanting the other way, but not all the way back). Then, it should recurse deeper again to MaxRecursionDepth and unroll to IntermediateRecursionDepth, reapeated as many times as indicated by the third agument, NumberOfPeaks, before unrolling to complete the program. The printout should look like a tipped-over contour of a row of mountain peaks separated by valleys, the peak height, number of peaks and valley depths given by the three arguments. If you have been writing recursive functions every day the last ten years, this is quite trivial. But if you are a student who heard the term 'recursion' for the first time last week, it takes some fiddeling to get those termination tests (and re-recursing tests) right. And then, when you see the working solution, you won't understand why it took that much effort to get it correct :-)

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #27

                Except we wouldn't use recursion, would we? :suss:

                K 1 Reply Last reply
                0
                • C Chris Maunder

                  Friday's coming up. Any thoughts on our next coding challenge? We need a simple task, easily coded, and easily tested.

                  cheers Chris Maunder

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #28

                  Implementing games is good exercise. The first game I implemented (in BASIC-plus on a PDP-11 in 1983) was Master Mind. How about a function that determines the black/white counts for two arrays of items -- not just arrays of four colors, but two IList<IEquatable>s of equal size. (Well, maybe don't state it so .net-specific.)

                  1 Reply Last reply
                  0
                  • C Chris Maunder

                    Friday's coming up. Any thoughts on our next coding challenge? We need a simple task, easily coded, and easily tested.

                    cheers Chris Maunder

                    B Offline
                    B Offline
                    Baraaaaaa
                    wrote on last edited by
                    #29

                    adventofcode.com will begin tomorrow.

                    1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      Except we wouldn't use recursion, would we? :suss:

                      K Offline
                      K Offline
                      kalberts
                      wrote on last edited by
                      #30

                      I can draw a zigzag line witout using a computer at all! It wouldn't teach me much about terminating a recursion, though.

                      1 Reply Last reply
                      0
                      • M Mark_Wallace

                        How about "Do something to make my life* easier"? * Mine, that is.

                        I wanna be a eunuchs developer! Pass me a bread knife!

                        K Offline
                        K Offline
                        Kyle Moyer
                        wrote on last edited by
                        #31

                        Need someone to finish that novel for you? ;P

                        1 Reply Last reply
                        0
                        • J Jon McKee

                          I know I wouldn't want to spend all my time in a week looking over 20+ KLOC from 15+ entries, testing them to ensure they meet the requirements, and then using some metric to rate which came out on top. Depending on complexity that might be a restrained estimate as well X|

                          B Offline
                          B Offline
                          BillWoodruff
                          wrote on last edited by
                          #32

                          Hi, Jon, I would distinguish the relative difficulty of a problem from whether or not a problem inherently demands a lengthy solution.

                          «There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008

                          J 1 Reply Last reply
                          0
                          • B BillWoodruff

                            Hi, Jon, I would distinguish the relative difficulty of a problem from whether or not a problem inherently demands a lengthy solution.

                            «There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008

                            J Offline
                            J Offline
                            Jon McKee
                            wrote on last edited by
                            #33

                            Very true. Difficulty does not necessarily equate to lines of code. Personally, I come up with very few ideas when attempting to meet the criteria of difficult while staying within reasonable amounts of required code. That aren't exclusively mathematics that is - gotta mix it up. I'm all for it though if people have ideas :thumbsup:

                            1 Reply Last reply
                            0
                            • C Chris Maunder

                              Friday's coming up. Any thoughts on our next coding challenge? We need a simple task, easily coded, and easily tested.

                              cheers Chris Maunder

                              J Offline
                              J Offline
                              Jon McKee
                              wrote on last edited by
                              #34

                              If you're looking for another string manipulation challenge, what about converting an input string to pig-latin? (Also where's the new challenge! I'm jonesing over here :~ )

                              1 Reply Last reply
                              0
                              • J Jon McKee

                                Idea: Rotating an NxN matrix in-place, maybe? Question: What exactly are the answers graded on? Creativity, complexity, simplicity, or some other metric?

                                P Offline
                                P Offline
                                PIEBALDconsult
                                wrote on last edited by
                                #35

                                I have come to the conclusion that (depending on what you are actually doing) you don't need to actually rotate an NxN matrix -- you need only apply a transformation to the X and Y coordinates of the desired cell to access a cell as if the matrix had been rotated. :cool:

                                J 1 Reply Last reply
                                0
                                • P PIEBALDconsult

                                  I have come to the conclusion that (depending on what you are actually doing) you don't need to actually rotate an NxN matrix -- you need only apply a transformation to the X and Y coordinates of the desired cell to access a cell as if the matrix had been rotated. :cool:

                                  J Offline
                                  J Offline
                                  Jon McKee
                                  wrote on last edited by
                                  #36

                                  I know some people that use a similar technique with work :laugh:

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups