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. Poetry Written in Code Contest

Poetry Written in Code Contest

Scheduled Pinned Locked Moved The Lounge
tutorial
45 Posts 34 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.
  • R Rage

    if (life == ToBe)
    return Question
    else if (life != ToBe)
    return Question

    M Offline
    M Offline
    Member 4289613
    wrote on last edited by
    #16

    We can optimize it! :))

    if (life == ToBe || life != ToBe)
    return Question

    So, finally, that's the statement:

    if (true)
    return Question

    1 Reply Last reply
    0
    • R Rage

      Seems like you are slightly getting all the subtleties of Shakespeare's genius ;P OTOH, it is disastrous to see how the best translation in programming language, namely return Question; ( as you very correctly pointed out ) completely ruins the effect.

      N Offline
      N Offline
      Norman Dziedzic
      wrote on last edited by
      #17

      Question = (2 * b) || !(2 * b); Is a nicer form but still only = Question; Then again Wit.soul = brevity;

      H A 2 Replies Last reply
      0
      • A Andrew Rissing

        A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

        float myhope;
        float mypride;
        if (myhope is Empty)
        Goto ZeroDivide;

        U Offline
        U Offline
        User 8527408
        wrote on last edited by
        #18

        //OK, so it's plagerism! bool shallI; string thee; shallI = chkShallI.Checked; thee = txtYou.Text; string str1 = "Summers Day"; woman thou; if (shallI) { if (thee.Compare(str1) > 0) { thou.Loveliness += str1.Loveliness; //string extension method thou.Temperateness += str1.Temperateness // or you.Temperature ?? } else { thou.Loveliness -= str1.Loveliness; thou.Temperateness -= str1.Temperateness } }

        1 Reply Last reply
        0
        • L Lost User

          /* Program LIFE
          Implementation date: 04/12/60
          Author: H.H. Evans
          www.hiraethog.org
          Notes: Run once only.
          Parameters: None.
          Date : 07/10/95
          */

          While NOT EndOfLife
          DO();
          Seek_Nipple();
          Mimic_Betters();
          Rebel();
          Seek_Nipple();

            MULTIPLY self BY wife GIVING children;
            If Age < PastCaring% then
               Birthday\_Candles% = Birthday\_Candles% + 1;
            endIf
          
            Regret(Lost\_Opportunity);
            WishFor(Youth);
            ACCEPT Fate;
          

          ENDDO;

          EndWhile;

          STOP RUN.

          www.hiraethog.org

          P Offline
          P Offline
          Peter Kassenaar
          wrote on last edited by
          #19

          Very Nice. The full circle of life in a while loop.

          1 Reply Last reply
          0
          • A Andrew Rissing

            A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

            float myhope;
            float mypride;
            if (myhope is Empty)
            Goto ZeroDivide;

            J Offline
            J Offline
            Jeffrey Ryman
            wrote on last edited by
            #20

            I don't have a poem, but I do have an interesting (I hope) story. I learned to program back in the 1960s on IBM equipment using punch cards. One evening four years ago I was waiting for my food in a Mexican fast food joint in Las Vegas and having a casual conversation with a couple of other customers about my age when the discussion somehow turned to old computers and using cards. It turned out that this lady and her husband had been programmers in the military back during the Vietnam war. While her husband was stationed someplace in South Vietnam, she was back in the US. During the period he remained overseas they exchanged love letters on punch cards. Their correspondence may or may not have rhymed, but I'm sure it was poetry to them. :-D

            1 Reply Last reply
            0
            • A Andrew Rissing

              A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

              float myhope;
              float mypride;
              if (myhope is Empty)
              Goto ZeroDivide;

              M Offline
              M Offline
              Mark Miller
              wrote on last edited by
              #21

              :laugh: Wow! Does this mean I can use Goto in my code again? :laugh: Oh, Goto, I've missed you so You so helped my code to blow Now you've come to me again I can write again with sin! Ok, so it isn't in code, but it's about code...

              Sincerely, -Mark mamiller@rhsnet.org

              1 Reply Last reply
              0
              • S StephenPhillips

                if (life == ToBe)
                return Question;
                else if (life != ToBe)
                return Question;

                given only two wholly mutually exclusive conditions, this could be simplified to

                return Question;

                Either Hamlet was overcomplicating his problem or he was a stickler for convolution. Or perhaps it should be taken more literally as

                return (ToBe == true);

                But no, this is silly - this only takes the first condition and ignores the rest of the system specification. Besides which, it somehow doesn't have the same ring to it this way.

                C Offline
                C Offline
                CaptJosh
                wrote on last edited by
                #22

                Perhaps make the two conditions and make them part of the same conditional? e.g.

                if ((life == ToBe ) || ( life != ToBe ))
                return Question;

                CaptJosh There are only 10 kinds of people in the world; those who understand binary and those who don't.

                1 Reply Last reply
                0
                • A Andrew Rissing

                  A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

                  float myhope;
                  float mypride;
                  if (myhope is Empty)
                  Goto ZeroDivide;

                  M Offline
                  M Offline
                  Michael A Cochran
                  wrote on last edited by
                  #23

                  How about SQL? DECLARE @ROSE CHAR(1); SELECT @ROSE=IS_ROSE FROM GARDEN WHERE NAME IN (SELECT @NAME FROM NAMES); DECLARE @IS_SWEET CHAR(1); SELECT @IS_SWEET=@IS_ROSE;

                  1 Reply Last reply
                  0
                  • A Andrew Rissing

                    A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

                    float myhope;
                    float mypride;
                    if (myhope is Empty)
                    Goto ZeroDivide;

                    S Offline
                    S Offline
                    SirTimothy
                    wrote on last edited by
                    #24

                    Adapted from an excerpt from Dr. Seuss' Fox In Socks. Not quite as smooth as I'd like, but it works.

                    if (fighter1 is TweetleBeetle
                    && fighter2 is TweetleBeetle
                    && theWeapon is Paddle
                    && thePlace is Puddle
                    && thePlace.place is Bottle)
                    return new TweetleBeetleBottlePuddlePaddleBattleMuddle();

                    If fighter one is tweetle beetle, Fighter two is tweetle beetle, And the weapon is a paddle, And the place is a puddle, And the place's place is bottle, then return new TweetleBeetleBottlePuddlePaddleBattleMuddle

                    1 Reply Last reply
                    0
                    • A Andrew Rissing

                      A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

                      float myhope;
                      float mypride;
                      if (myhope is Empty)
                      Goto ZeroDivide;

                      A Offline
                      A Offline
                      Aiscrim
                      wrote on last edited by
                      #25

                      If this is real Then
                      Nothing
                      Else
                      matters(2, Me)

                      1 Reply Last reply
                      0
                      • D Dalek Dave

                        . . / | { , , SYSTEM HALTED

                        . . / Ampersand bracket bracket dot dot slash, | { , , SYSTEM HALTED Vertical-bar curly-bracket comma comma CRASH.

                        ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]

                        A Offline
                        A Offline
                        Alan Burkhart
                        wrote on last edited by
                        #26

                        :thumbsup::thumbsup:

                        XAlan Burkhart

                        1 Reply Last reply
                        0
                        • A Andrew Rissing

                          A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

                          float myhope;
                          float mypride;
                          if (myhope is Empty)
                          Goto ZeroDivide;

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

                          Note: at the time I wrote this, I had not read the other posts, and did not realize others were already taking on Hamlet's famous soliloquy.

                          // c#

                          bool? TheQuestion = true;
                          bool? ToBe = true;

                          public bool? ToBeOrNotToBe()
                          {
                          return (TheQuestion == true && ToBe == true) ? ToBe : null;
                          }

                          "Our life is a faint tracing on the surface of mystery, like the idle, curved tunnels of leaf miners on the surface of a leaf. We must somehow take a wider view, look at the whole landscape, really see it, and describe what's going on here. Then we can at least wail the right question into the swaddling band of darkness, or, if it comes to that, choir the proper praise." Annie Dillard

                          1 Reply Last reply
                          0
                          • A Andrew Rissing

                            A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

                            float myhope;
                            float mypride;
                            if (myhope is Empty)
                            Goto ZeroDivide;

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #28

                            Charlie and Charlotte, the lovers in C (doesn't compile, Charlie and Charlotte are incompatible types)

                            char*lie;
                            double time, me= !0XFACE,
                            not; int rested, get, out;
                            main(ly, die) char ly, **die ;{
                            signed char lotte,

                            dear; (char)lotte--;
                            for(get= !me;; not){
                            1 - out & out ;lie;{
                            char lotte, my= dear,
                            **let= !!me *!not+ ++die;
                            (char*)(lie=
                            "The gloves are OFF this time, I detest you, snot\n\0sed GEEK!");

                            do {not= \*lie++ & 0xF00L\* !me;
                            #define love (char\*)lie -
                            love 1s \*!(not= atoi(let
                            \[get -me?
                                (char)lotte-
                            

                            (char)lotte: my- *love -
                            'I' - *love - 'U' -
                            'I' - (long) - 4 - 'U' ])- !!
                            (time =out= 'a'));} while( my - dear
                            && 'I'-1l -get- 'a'); break;}}
                            (char)*lie++;

                            (char)*lie++, (char)*lie++; hell:0, (char)*lie;
                            get *out* (short)ly -0-'R'- get- 'a'^rested;
                            do {auto*eroticism,
                            that; puts(*( out
                            - 'c'
                            -('P'-'S') +die+ -2 ));}while(!"you're at it");

                            for (*((char*)&lotte)^=
                            (char)lotte; (love ly) [(char)++lotte+
                            !!0xBABE];){ if ('I' -lie[ 2 +(char)lotte]){ 'I'-1l ***die; }
                            else{ if ('I' * get *out* ('I'-1l **die[ 2 ])) *((char*)&lotte) -=
                            '4' - ('I'-1l); not; for(get=!

                            get; !out; (char)*lie & 0xD0- !not) return!!
                            (char)lotte;}

                            (char)lotte;
                            do{ not* putchar(lie [out
                            *!not* !!me +(char)lotte]);
                            not; for(;!'a';);}while(
                            love (char*)lie);{

                            register this; switch( (char)lie
                            [(char)lotte] -1s *!out) {
                            char*les, get= 0xFF, my; case' ':
                            *((char*)&lotte) += 15; !not +(char)*lie*'s';
                            this +1s+ not; default: 0xF +(char*)lie;}}}
                            get - !out;
                            if (not--)
                            goto hell;
                            exit( (char)lotte);}

                            Bastard Programmer from Hell :suss:

                            1 Reply Last reply
                            0
                            • N Norman Dziedzic

                              Question = (2 * b) || !(2 * b); Is a nicer form but still only = Question; Then again Wit.soul = brevity;

                              H Offline
                              H Offline
                              hmoulding
                              wrote on last edited by
                              #29

                              ITYM wit.soul = brevity ;

                              1 Reply Last reply
                              0
                              • A Andrew Rissing

                                A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

                                float myhope;
                                float mypride;
                                if (myhope is Empty)
                                Goto ZeroDivide;

                                M Offline
                                M Offline
                                msvbdev
                                wrote on last edited by
                                #30

                                Not really a poem, but here's some famous Shakespeare in C/C++

                                bool question = (toBe || !toBe);

                                1 Reply Last reply
                                0
                                • A Andrew Rissing

                                  A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

                                  float myhope;
                                  float mypride;
                                  if (myhope is Empty)
                                  Goto ZeroDivide;

                                  D Offline
                                  D Offline
                                  da808wiz
                                  wrote on last edited by
                                  #31

                                  ...
                                  send(girl,"Flowers");
                                  send(girl,"Chocolates");
                                  send(girl,"Money");
                                  send(girl,"Heart");
                                  if ( recv(girl)==cold_shoulder )
                                  goto hell;
                                  ...

                                  :hell
                                  switch ( girl2 = new Girl() ) {
                                  ...

                                  1 Reply Last reply
                                  0
                                  • A Andrew Rissing

                                    A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

                                    float myhope;
                                    float mypride;
                                    if (myhope is Empty)
                                    Goto ZeroDivide;

                                    U Offline
                                    U Offline
                                    User 8077241
                                    wrote on last edited by
                                    #32

                                    Class TimeGoesBySlowly

                                    Function toSave(yourLife) As TimeGoesBySlowly
                                    
                                        For Each Day As TimeGoesBySlowly In yourLife
                                            Dim theLights As New TimeGoesBySlowly, TaketheTime
                                    
                                            toSave(yourLife) 'and
                                            Return (theLights) 'until the
                                    
                                        Next Day
                                    
                                    
                                    End Function
                                    

                                    End Class

                                    http://thephilosopherstone.ca

                                    A 1 Reply Last reply
                                    0
                                    • A Andrew Rissing

                                      A few coworkers were joking about writing poetry in code and I was curious to put it up here as a challenge to others. The premise is that you must write something that is poetry that is reasonably compilable (i.e. excluding the scaffolding of the language of choice). Bonus points if it produces output that is relevant to the theme of the poem. Here is an example to get you started:

                                      float myhope;
                                      float mypride;
                                      if (myhope is Empty)
                                      Goto ZeroDivide;

                                      M Offline
                                      M Offline
                                      MacSpudster
                                      wrote on last edited by
                                      #33

                                      interface EternalLove
                                      {
                                      object ofMyDesire;
                                      byte ofMyLoveAspire;

                                      string meAlong;
                                      double mySong;

                                      private class ofYourAffection : ICollection {}

                                      enum erateMyLoveForYou
                                      {
                                      rosesBought,
                                      diamondsSought,
                                      muchMuchThought
                                      }

                                      public abstract Array Divine;
                                      protected Buffer recline;

                                      readonly int endedProse;
                                      long erWoes;

                                      Exception Denied;
                                      ExceptionHandler.ExceptionDialog AgonyUponMyPride;

                                      StackOverflowException soMuchCommotion;
                                      Screen myEmotion;

                                      EventHandler ABrandNewDay;
                                      Environment Secure_SoTheySay;

                                      Help MeFindAWife; //as I
                                      float alongThroughLife;
                                      }

                                      public class icWishfulThinking : EternalLove
                                      {
                                      //Son, yer on yer own.
                                      }

                                      ~ [Don't] Visual[ize the] Basic[s], C#[ly instead] ~ ASPX: Apple Simply Performs eXcellently

                                      A 1 Reply Last reply
                                      0
                                      • U User 8077241

                                        Class TimeGoesBySlowly

                                        Function toSave(yourLife) As TimeGoesBySlowly
                                        
                                            For Each Day As TimeGoesBySlowly In yourLife
                                                Dim theLights As New TimeGoesBySlowly, TaketheTime
                                        
                                                toSave(yourLife) 'and
                                                Return (theLights) 'until the
                                        
                                            Next Day
                                        
                                        
                                        End Function
                                        

                                        End Class

                                        http://thephilosopherstone.ca

                                        A Offline
                                        A Offline
                                        Andrew Rissing
                                        wrote on last edited by
                                        #34

                                        Nice. +5

                                        1 Reply Last reply
                                        0
                                        • M MacSpudster

                                          interface EternalLove
                                          {
                                          object ofMyDesire;
                                          byte ofMyLoveAspire;

                                          string meAlong;
                                          double mySong;

                                          private class ofYourAffection : ICollection {}

                                          enum erateMyLoveForYou
                                          {
                                          rosesBought,
                                          diamondsSought,
                                          muchMuchThought
                                          }

                                          public abstract Array Divine;
                                          protected Buffer recline;

                                          readonly int endedProse;
                                          long erWoes;

                                          Exception Denied;
                                          ExceptionHandler.ExceptionDialog AgonyUponMyPride;

                                          StackOverflowException soMuchCommotion;
                                          Screen myEmotion;

                                          EventHandler ABrandNewDay;
                                          Environment Secure_SoTheySay;

                                          Help MeFindAWife; //as I
                                          float alongThroughLife;
                                          }

                                          public class icWishfulThinking : EternalLove
                                          {
                                          //Son, yer on yer own.
                                          }

                                          ~ [Don't] Visual[ize the] Basic[s], C#[ly instead] ~ ASPX: Apple Simply Performs eXcellently

                                          A Offline
                                          A Offline
                                          Andrew Rissing
                                          wrote on last edited by
                                          #35

                                          Haha...nice. +5

                                          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