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. Coding Challenge of the week

Coding Challenge of the week

Scheduled Pinned Locked Moved The Lounge
comhelp
13 Posts 8 Posters 0 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 Offline
    C Offline
    Chris Maunder
    wrote on last edited by
    #1

    As something a little different we've launched a coding challenge of the week. A weekly simple programming problem that should take no more than half an hour or so, with the best answer winning a CodeProject T-shirt. The first challenge is up, and it's culled directly from a problem we faced internally: Coding challenge: bad word filter[^] If anyone has any small programming challenges they'd like to submit for the next challenge please send them to me (chris@codeproject.com).

    cheers Chris Maunder

    OriginalGriffO M F R K 5 Replies Last reply
    0
    • C Chris Maunder

      As something a little different we've launched a coding challenge of the week. A weekly simple programming problem that should take no more than half an hour or so, with the best answer winning a CodeProject T-shirt. The first challenge is up, and it's culled directly from a problem we faced internally: Coding challenge: bad word filter[^] If anyone has any small programming challenges they'd like to submit for the next challenge please send them to me (chris@codeproject.com).

      cheers Chris Maunder

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Quote:

      Use any language in your answer except profanity.

      Does that mean I can or can't use Brainf*ck[^]?

      Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      C 1 Reply Last reply
      0
      • C Chris Maunder

        As something a little different we've launched a coding challenge of the week. A weekly simple programming problem that should take no more than half an hour or so, with the best answer winning a CodeProject T-shirt. The first challenge is up, and it's culled directly from a problem we faced internally: Coding challenge: bad word filter[^] If anyone has any small programming challenges they'd like to submit for the next challenge please send them to me (chris@codeproject.com).

        cheers Chris Maunder

        M Offline
        M Offline
        megaadam
        wrote on last edited by
        #3

        Easy!

        if(str.length() == 4)
        {
        str = "elephant";
        }

        ... such stuff as dreams are made on

        J A 2 Replies Last reply
        0
        • M megaadam

          Easy!

          if(str.length() == 4)
          {
          str = "elephant";
          }

          ... such stuff as dreams are made on

          J Offline
          J Offline
          Johnny J
          wrote on last edited by
          #4

          Nice try, but that code doesn't take sunshines into consideration! :doh:

          Anything that is unrelated to elephants is irrelephant
          Anonymous
          -----
          The problem with quotes on the internet is that you can never tell if they're genuine
          Winston Churchill, 1944
          -----
          I'd just like a chance to prove that money can't make me happy.
          Me, all the time

          1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            Quote:

            Use any language in your answer except profanity.

            Does that mean I can or can't use Brainf*ck[^]?

            Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

            C Offline
            C Offline
            Chris Maunder
            wrote on last edited by
            #5

            I almost started a stopwatch to see how long it would take for that comment ;)

            cheers Chris Maunder

            OriginalGriffO 1 Reply Last reply
            0
            • C Chris Maunder

              I almost started a stopwatch to see how long it would take for that comment ;)

              cheers Chris Maunder

              OriginalGriffO Offline
              OriginalGriffO Offline
              OriginalGriff
              wrote on last edited by
              #6

              Does that mean I won a T-shirt for posting first? :laugh:

              Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

              "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
              "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

              1 Reply Last reply
              0
              • C Chris Maunder

                As something a little different we've launched a coding challenge of the week. A weekly simple programming problem that should take no more than half an hour or so, with the best answer winning a CodeProject T-shirt. The first challenge is up, and it's culled directly from a problem we faced internally: Coding challenge: bad word filter[^] If anyone has any small programming challenges they'd like to submit for the next challenge please send them to me (chris@codeproject.com).

                cheers Chris Maunder

                F Offline
                F Offline
                F ES Sitecore
                wrote on last edited by
                #7

                How long until someone copies and pastes the question in an attempt to get someone else to do the work for them.

                OriginalGriffO 1 Reply Last reply
                0
                • F F ES Sitecore

                  How long until someone copies and pastes the question in an attempt to get someone else to do the work for them.

                  OriginalGriffO Offline
                  OriginalGriffO Offline
                  OriginalGriff
                  wrote on last edited by
                  #8

                  Does this[^] count?

                  Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                  "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                  R 1 Reply Last reply
                  0
                  • OriginalGriffO OriginalGriff

                    Does this[^] count?

                    Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

                    R Offline
                    R Offline
                    Rage
                    wrote on last edited by
                    #9

                    Exactly ! If it works and Chris gets by with it by only giving out a T-Shirt, I think we can name it a good deal.

                    Do not escape reality : improve reality !

                    1 Reply Last reply
                    0
                    • C Chris Maunder

                      As something a little different we've launched a coding challenge of the week. A weekly simple programming problem that should take no more than half an hour or so, with the best answer winning a CodeProject T-shirt. The first challenge is up, and it's culled directly from a problem we faced internally: Coding challenge: bad word filter[^] If anyone has any small programming challenges they'd like to submit for the next challenge please send them to me (chris@codeproject.com).

                      cheers Chris Maunder

                      R Offline
                      R Offline
                      Rage
                      wrote on last edited by
                      #10

                      Chris Maunder wrote:

                      The first challenge is up

                      I suppose we unit test using Michael's posts ?

                      Chris Maunder wrote:

                      If anyone has any small programming challenges they'd like to submit for the next challenge please send them to me

                      Awesome, free workforce !

                      Do not escape reality : improve reality !

                      1 Reply Last reply
                      0
                      • C Chris Maunder

                        As something a little different we've launched a coding challenge of the week. A weekly simple programming problem that should take no more than half an hour or so, with the best answer winning a CodeProject T-shirt. The first challenge is up, and it's culled directly from a problem we faced internally: Coding challenge: bad word filter[^] If anyone has any small programming challenges they'd like to submit for the next challenge please send them to me (chris@codeproject.com).

                        cheers Chris Maunder

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

                        When I read this, I just had to think of this: http://thedailywtf.com/articles/The-Clbuttic-Mistake-

                        1 Reply Last reply
                        0
                        • M megaadam

                          Easy!

                          if(str.length() == 4)
                          {
                          str = "elephant";
                          }

                          ... such stuff as dreams are made on

                          A Offline
                          A Offline
                          AndrewDavie
                          wrote on last edited by
                          #12

                          Easier.

                          if(str.length() > 0) { str = ""; }

                          It's impossible filter for every single word that people may find offensive, so you need to get rid of them all. eg. "I like Ds. Big Ds. I like to think long and hard about Ds." Gets past pretty much every word filter there is.

                          M 1 Reply Last reply
                          0
                          • A AndrewDavie

                            Easier.

                            if(str.length() > 0) { str = ""; }

                            It's impossible filter for every single word that people may find offensive, so you need to get rid of them all. eg. "I like Ds. Big Ds. I like to think long and hard about Ds." Gets past pretty much every word filter there is.

                            M Offline
                            M Offline
                            megaadam
                            wrote on last edited by
                            #13

                            I can optimize that!

                            str = "";

                            ... such stuff as dreams are made on

                            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