• 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!

A challenge to the coders here

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

    #11
    Originally posted by Troll View Post
    var pulse = 0;
    while (pulse>0) {
    shag(pulse);
    pulse++;
    }
    wouldn't you end up shagging until your stack overfloweth?

    Comment


      #12
      Originally posted by Troll View Post
      var pulse = 0;
      while (pulse>0) {
      shag(pulse);
      pulse++;
      }
      Originally posted by Bacchus View Post
      wouldn't you end up shagging until your stack overfloweth?
      No, because pulse starts of as zero, so the while clause is never true, so pulse never increases. He's dead Jim.

      Originally posted by minestrone View Post
      public void testWoman( Male me , Female woman) {

      assertEquals( me.wantsBeer() , woman.getsBeerWhenManWants() ) ;
      assertEquals( me.wantsSex() , woman.getsNakedWhenManWants() ) ;
      assertEquals( me.wantsFootballOnTv() , woman.getsSkyControllerWhenManWants() ) ;

      }

      I strongly typed there, no polymorphism in that method.
      Fail. Why on earth would you ever allow the woman to even touch the remote control?

      Code:
      METHOD valentine_poem.
      
        DATA: lr_descr   TYPE REF TO cl_abap_typedescr,
              lr_roses   TYPE REF TO zcl_flowers,
              lr_violets TYPE REF TO zcl_flowers.
      
        lr_roses = zcl_flowers=>factory( zcl_flowers=>c_roses ).
        lr_violets = zcl_flowers=>factory( zcl_flowers=>c_violets ).
         
        " Poem logic
        IF lr_roses->is_permitted_colour( 'red' ) EQ abap_true AND lr_violets->is_permitted_colour('blue') NE abap_false.
          lr_descr = cl_abap_typedescr=>describe_by_data( me ).
          ASSERT lr_descr->absolute_name EQ 'ZCL_HAIKU'.
        ENDIF.
      
      ENDMETHOD.
      If Roses are red
      And violets sometimes blue
      This is a Haiku
      Down with racism. Long live miscegenation!

      Comment


        #13
        Man you = new Man();

        Comment


          #14
          Originally posted by Troll View Post
          var pulse = 140;
          var stillWarm=true;
          while ((pulse>0)||(stillWarm)) {
          shag(pulse);
          pulse--;
          }
          FTFY

          Comment


            #15
            Talk about overcomplicating your code!


            while (true) {
            shag();
            }

            I believe this has the same effect.

            Comment


              #16
              Originally posted by Bunk View Post
              var mitchTheTester = {};
              mitchTheTester.wood = true;

              FTFY
              Never has a man been heard to say on his death bed that he wishes he'd spent more time in the office.

              Comment


                #17
                Originally posted by Troll View Post
                var pulse = 0;
                while (pulse>0) {
                shag(pulse);
                pulse++;
                }
                Leaving aside that would do nothing, I've optmised it using MMX assembler for you:

                mov esi, women
                mov ecx, pulse
                pxor mm7,mm7

                loop:
                movq mm0, [esi]
                pshagusw mm0, mm7 ; shag 4 women simultaneously
                add esi, 8
                dec ecx
                cmp ecx, 0
                jz loop
                Will work inside IR35. Or for food.

                Comment


                  #18
                  Originally posted by VectraMan View Post
                  Leaving aside that would do nothing, I've optmised it using MMX assembler for you:

                  mov esi, women
                  mov ecx, pulse
                  pxor mm7,mm7

                  loop:
                  movq mm0, [esi]
                  pshagusw mm0, mm7 ; shag 4 women simultaneously
                  add esi, 8
                  dec ecx
                  cmp ecx, 0
                  jz loop
                  And you wonder why you're not getting any!

                  Comment


                    #19
                    easy to see why there are so many sad lonely singletons on this site.
                    Hard Brexit now!
                    #prayfornodeal

                    Comment


                      #20
                      Originally posted by sasguru View Post
                      easy to see why there are so many sad lonely singletons on this site.
                      Implementing Singleton in C#

                      Comment

                      Working...
                      X