• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Attn code monkeys - re: FizzBuzz

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Attn code monkeys - re: FizzBuzz

    Write a piece of code which prints each integer from 1 to 100 inclusively each on a separate line (use \n, vbCrLf, <br>, whatever), but if the number is divisible by 3 instead of the number print "Fizz", similary if it is divisible by 5 print "Buzz", and if it is divisible by both 3 and 5 print "FizzBuzz".

    This simulates an old popular children's or drinking game.

    If you decide to try this do it first, then read http://tickletux.wordpress.com/2007/...o-grok-coding/

    #2
    Why can't it be done in assembly?

    threaded.

    Comment


      #3
      Originally posted by AtW
      Why can't it be done in assembly?

      threaded.
      I hate people who answer their own questions.

      Comment


        #4
        Things like this are interesting because they serve to confirm what you always suspect: your co-workers are idiots.

        I had to do the test - couldn't resist - took under 2 minutes.

        Comment


          #5
          "Things like this are interesting because they serve to confirm what you always suspect: your co-workers are idiots.

          I had to do the test - couldn't resist - took under 2 minutes."

          Which confirms my reasoning that people who undertake these tests are idiots. It has no commercial value to do it, benefits no-one and uses up resource but alas most techies just do it as opposed to asking the question. Why?
          What happens in General, stays in General.
          You know what they say about assumptions!

          Comment


            #6
            Originally posted by MarillionFan
            "Things like this are interesting because they serve to confirm what you always suspect: your co-workers are idiots.

            I had to do the test - couldn't resist - took under 2 minutes."

            Which confirms my reasoning that people who undertake these tests are idiots. It has no commercial value to do it, benefits no-one and uses up resource but alas most techies just do it as opposed to asking the question. Why?

            Meaning you couldn't do it

            I struggled like - if I could have the values 1 - 100 stored in a table, then I would have done it in minutes with a little pl/sql function.
            But faced with a SQL*Plus session alone - nah gave up after 5 mins, unless I'm allowed to change the code each time.

            I must be thick

            Wah

            Crisps well and truly pissed on
            The pope is a tard.

            Comment


              #7
              "Meaning you couldn't do it"

              No its very easy. I just don't see why.

              Far too many people do what they're told and dont see the big picture.
              What happens in General, stays in General.
              You know what they say about assumptions!

              Comment


                #8
                Originally posted by MarillionFan
                "Meaning you couldn't do it"

                No its very easy. I just don't see why.

                Far too many people do what they're told and dont see the big picture.
                No wonder you keep getting bounced off site.

                Comment


                  #9
                  Originally posted by MarillionFan
                  Far too many people do what they're told and dont see the big picture.
                  See my comment on the link:

                  Having read almost every comment on this story I’d probably sack the lot of you.
                  Where’s the input parameters?
                  Where’s the modularity?
                  What happens if in 6 months time the requirements change to 4 and 7 being the fizzbuzz numbers?
                  What happens when the program needs to be used by the french team who need le fizz le buzz?
                  What happens when the program is up-scaled to cover 0-1000
                  Coffee's for closers

                  Comment


                    #10
                    and my comment
                    What happens in General, stays in General.
                    You know what they say about assumptions!

                    Comment

                    Working...
                    X