Loading ...
Sorry, an error occurred while loading the content.

Re: [JavaScript] Tim/My Valentine's Day Script!!!

Expand Messages
  • Tim Sabin
    Good for you, Karen. Go tell Mr. Vessell that the more compact the code, the better. When I was in college, we were posed a problem. I thought about it, and
    Message 1 of 4 , Jul 28, 2005
    • 0 Attachment
      Good for you, Karen.

      Go tell Mr. Vessell that the more compact the code, the better.

      When I was in college, we were posed a problem. I thought about it, and
      came up with a very convoluted solution. Apparently, about 90% of the
      class did it the more straight-forward way. The instructor wrote in her
      book, "Tim Sabin wrote a very long program that worked." I got an A on
      the assignment, but I rather would have gotten a better note in her
      notebook. Like, maybe I had found a better way to program it??? :-)

      --Tim Sabin

      > *WOO HOO* Tim!! I did it!!!!
      > (I know it had been a few weeks but I did it!!)
      > I finished my script last night and turned it in and it works great!!
      > My first script I wrote myself!! *whew* it was challenging!!
      > Here it is!! (I have to write the code for my instructor as .html
      code!!)
      > But...as you can see...I had to get the script to let us know how
      many days
      > were left until Valentine's Day.
      > Then I had to get the script to let us know what day of the week
      Valentine's
      > day fell on. So...I declared an array and had it find the day!!
      > Mr. Vessell said I took the "easy" way out!!
      > But gave me full credit because it worked!!
      > He wanted me to use the switch method!!
      > (Which is what he used in his example!!)
      >
      > I thought of this all on my own!!!!
      > *Woo Hoo*
      > -----------------------------------------------------------------
      >
      > <html>
      > <head>
      > <title>Valentine's Day Script</title>
      > </head>
      > <body>
      > <script language="JavaScript1.2">
      > <!--
      > var today=new Date();
      > var Valentine=new Date(today.getFullYear(), 1, 14);
      > if(today.getMonth() == 1 && today.getDate() == 14)
      > {
      > alert("Today is Valentine's Day");
      > }
      > else
      > if (Valentine < today)
      > {
      > Valentine.setFullYear(Valentine.getFullYear() + 1);
      > }
      > var Difference=Valentine-today;
      > var ValDay = Math.ceil(Difference/1000/60/60/24);
      > document.write("There are " + ValDay + " days til Valentine's Day")
      > document.write("<br>")
      > var day_names = new Array (7)
      > day_names[0] = "Sunday"
      > day_names[1] = "Monday"
      > day_names[2] = "Tuesday"
      > day_names[3] = "Wednesday"
      > day_names[4] = "Thursday"
      > day_names[5] = "Friday"
      > day_names[6] = "Saturday"
      >
      > var day_name = day_names[Valentine.getDay()]
      > document.write("Valentine's Day is " + day_name)
      >
      >
      > //-->
      > </script>
      > </body>
      > </html>
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
    • Karenality
      quite possibly Tim!! Unless you re like me and (which I USUALLY do) and like to do things the LONG HARD WAY!!!! I just got lucky with this code!!! o.k. next
      Message 2 of 4 , Jul 29, 2005
      • 0 Attachment
        quite possibly Tim!!
        Unless you're like me and (which I USUALLY do)
        and like to do things the LONG HARD WAY!!!!
        I just got lucky with this code!!!

        o.k. next week: CREATING A POP UP AD!!!
        (like aren't those annoying? I think I'll make a pop up ad about how
        annoying pop up ads are!! LOL)

        GOOD NIGHT!!
        ~Karen

        -------Original Message-------

        From: Tim Sabin
        Date: 07/29/05 01:56:44
        To: javascript_official@yahoogroups.com
        Subject: Re: [JavaScript] Tim/My Valentine's Day Script!!!

        Good for you, Karen.

        Go tell Mr. Vessell that the more compact the code, the better.

        When I was in college, we were posed a problem. I thought about it, and
        came up with a very convoluted solution. Apparently, about 90% of the
        class did it the more straight-forward way. The instructor wrote in her
        book, "Tim Sabin wrote a very long program that worked." I got an A on
        the assignment, but I rather would have gotten a better note in her
        notebook. Like, maybe I had found a better way to program it??? :-)

        --Tim Sabin

        > *WOO HOO* Tim!! I did it!!!!
        > (I know it had been a few weeks but I did it!!)
        > I finished my script last night and turned it in and it works great!!
        > My first script I wrote myself!! *whew* it was challenging!!
        > Here it is!! (I have to write the code for my instructor as .html
        code!!)
        > But...as you can see...I had to get the script to let us know how
        many days
        > were left until Valentine's Day.
        > Then I had to get the script to let us know what day of the week
        Valentine's
        > day fell on. So...I declared an array and had it find the day!!
        > Mr. Vessell said I took the "easy" way out!!
        > But gave me full credit because it worked!!
        > He wanted me to use the switch method!!
        > (Which is what he used in his example!!)
        >
        > I thought of this all on my own!!!!
        > *Woo Hoo*
        > -----------------------------------------------------------------
        >
        > <html>
        > <head>
        > <title>Valentine's Day Script</title>
        > </head>
        > <body>
        > <script language="JavaScript1.2">
        > <!--
        > var today=new Date();
        > var Valentine=new Date(today.getFullYear(), 1, 14);
        > if(today.getMonth() == 1 && today.getDate() == 14)
        > {
        > alert("Today is Valentine's Day");
        > }
        > else
        > if (Valentine < today)
        > {
        > Valentine.setFullYear(Valentine.getFullYear() + 1);
        > }
        > var Difference=Valentine-today;
        > var ValDay = Math.ceil(Difference/1000/60/60/24);
        > document.write("There are " + ValDay + " days til Valentine's Day")
        > document.write("<br>")
        > var day_names = new Array (7)
        > day_names[0] = "Sunday"
        > day_names[1] = "Monday"
        > day_names[2] = "Tuesday"
        > day_names[3] = "Wednesday"
        > day_names[4] = "Thursday"
        > day_names[5] = "Friday"
        > day_names[6] = "Saturday"
        >
        > var day_name = day_names[Valentine.getDay()]
        > document.write("Valentine's Day is " + day_name)
        >
        >
        > //-->
        > </script>
        > </body>
        > </html>
        >
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >





        YAHOO! GROUPS LINKS

        Visit your group "javascript_official" on the web.

        To unsubscribe from this group, send an email to:
        javascript_official-unsubscribe@yahoogroups.com

        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.







        [Non-text portions of this message have been removed]
      • James Esslinger
        hey karen! im just starting my javascript class online from uis, any advice we be appreciated!! ... ____________________________________________________ Start
        Message 3 of 4 , Jul 29, 2005
        • 0 Attachment
          hey karen! im just starting my javascript class online
          from uis, any advice we be appreciated!!
          --- Karenality <karenality@...> wrote:

          > quite possibly Tim!!
          > Unless you're like me and (which I USUALLY do)
          > and like to do things the LONG HARD WAY!!!!
          > I just got lucky with this code!!!
          >
          > o.k. next week: CREATING A POP UP AD!!!
          > (like aren't those annoying? I think I'll make a pop
          > up ad about how
          > annoying pop up ads are!! LOL)
          >
          > GOOD NIGHT!!
          > ~Karen
          >
          > -------Original Message-------
          >
          > From: Tim Sabin
          > Date: 07/29/05 01:56:44
          > To: javascript_official@yahoogroups.com
          > Subject: Re: [JavaScript] Tim/My Valentine's Day
          > Script!!!
          >
          > Good for you, Karen.
          >
          > Go tell Mr. Vessell that the more compact the code,
          > the better.
          >
          > When I was in college, we were posed a problem. I
          > thought about it, and
          > came up with a very convoluted solution. Apparently,
          > about 90% of the
          > class did it the more straight-forward way. The
          > instructor wrote in her
          > book, "Tim Sabin wrote a very long program that
          > worked." I got an A on
          > the assignment, but I rather would have gotten a
          > better note in her
          > notebook. Like, maybe I had found a better way to
          > program it??? :-)
          >
          > --Tim Sabin
          >
          > > *WOO HOO* Tim!! I did it!!!!
          > > (I know it had been a few weeks but I did it!!)
          > > I finished my script last night and turned it in
          > and it works great!!
          > > My first script I wrote myself!! *whew* it was
          > challenging!!
          > > Here it is!! (I have to write the code for my
          > instructor as .html
          > code!!)
          > > But...as you can see...I had to get the script to
          > let us know how
          > many days
          > > were left until Valentine's Day.
          > > Then I had to get the script to let us know what
          > day of the week
          > Valentine's
          > > day fell on. So...I declared an array and had it
          > find the day!!
          > > Mr. Vessell said I took the "easy" way out!!
          > > But gave me full credit because it worked!!
          > > He wanted me to use the switch method!!
          > > (Which is what he used in his example!!)
          > >
          > > I thought of this all on my own!!!!
          > > *Woo Hoo*
          > >
          >
          -----------------------------------------------------------------
          > >
          > > <html>
          > > <head>
          > > <title>Valentine's Day Script</title>
          > > </head>
          > > <body>
          > > <script language="JavaScript1.2">
          > > <!--
          > > var today=new Date();
          > > var Valentine=new Date(today.getFullYear(), 1,
          > 14);
          > > if(today.getMonth() == 1 && today.getDate() == 14)
          > > {
          > > alert("Today is Valentine's Day");
          > > }
          > > else
          > > if (Valentine < today)
          > > {
          > >
          > Valentine.setFullYear(Valentine.getFullYear() + 1);
          > > }
          > > var Difference=Valentine-today;
          > > var ValDay = Math.ceil(Difference/1000/60/60/24);
          > > document.write("There are " + ValDay + " days til
          > Valentine's Day")
          > > document.write("<br>")
          > > var day_names = new Array (7)
          > > day_names[0] = "Sunday"
          > > day_names[1] = "Monday"
          > > day_names[2] = "Tuesday"
          > > day_names[3] = "Wednesday"
          > > day_names[4] = "Thursday"
          > > day_names[5] = "Friday"
          > > day_names[6] = "Saturday"
          > >
          > > var day_name = day_names[Valentine.getDay()]
          > > document.write("Valentine's Day is " + day_name)
          > >
          > >
          > > //-->
          > > </script>
          > > </body>
          > > </html>
          > >
          > >
          > > [Non-text portions of this message have been
          > removed]
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          >
          >
          >
          >
          >
          > YAHOO! GROUPS LINKS
          >
          > Visit your group "javascript_official" on the web.
          >
          > To unsubscribe from this group, send an email to:
          > javascript_official-unsubscribe@yahoogroups.com
          >
          > Your use of Yahoo! Groups is subject to the Yahoo!
          > Terms of Service.
          >
          >
          >
          >
          >
          >
          >
          > [Non-text portions of this message have been
          > removed]
          >
          >
          >
          >




          ____________________________________________________
          Start your day with Yahoo! - make it your home page
          http://www.yahoo.com/r/hs
        • Karenality
          Hon...I can TRY to give advice, but this is why I joined this group...So the pros can offer it to me!! (well...I ll share, tho!!) ~Karen ... From: James
          Message 4 of 4 , Jul 29, 2005
          • 0 Attachment
            Hon...I can TRY to give advice, but this is why I joined this group...So the
            pros can offer it to me!! (well...I'll share, tho!!)
            ~Karen

            -------Original Message-------

            From: James Esslinger
            Date: 07/29/05 18:43:42
            To: javascript_official@yahoogroups.com
            Subject: Re: [JavaScript] Tim/My Valentine's Day Script!!!


            hey karen! im just starting my javascript class online
            from uis, any advice we be appreciated!!
            --- Karenality <karenality@...> wrote:

            > quite possibly Tim!!
            > Unless you're like me and (which I USUALLY do)
            > and like to do things the LONG HARD WAY!!!!
            > I just got lucky with this code!!!
            >
            > o.k. next week: CREATING A POP UP AD!!!
            > (like aren't those annoying? I think I'll make a pop
            > up ad about how
            > annoying pop up ads are!! LOL)
            >
            > GOOD NIGHT!!
            > ~Karen
            >
            > -------Original Message-------
            >
            > From: Tim Sabin
            > Date: 07/29/05 01:56:44
            > To: javascript_official@yahoogroups.com
            > Subject: Re: [JavaScript] Tim/My Valentine's Day
            > Script!!!
            >
            > Good for you, Karen.
            >
            > Go tell Mr. Vessell that the more compact the code,
            > the better.
            >
            > When I was in college, we were posed a problem. I
            > thought about it, and
            > came up with a very convoluted solution. Apparently,
            > about 90% of the
            > class did it the more straight-forward way. The
            > instructor wrote in her
            > book, "Tim Sabin wrote a very long program that
            > worked." I got an A on
            > the assignment, but I rather would have gotten a
            > better note in her
            > notebook. Like, maybe I had found a better way to
            > program it??? :-)
            >
            > --Tim Sabin
            >
            > > *WOO HOO* Tim!! I did it!!!!
            > > (I know it had been a few weeks but I did it!!)
            > > I finished my script last night and turned it in
            > and it works great!!
            > > My first script I wrote myself!! *whew* it was
            > challenging!!
            > > Here it is!! (I have to write the code for my
            > instructor as .html
            > code!!)
            > > But...as you can see...I had to get the script to
            > let us know how
            > many days
            > > were left until Valentine's Day.
            > > Then I had to get the script to let us know what
            > day of the week
            > Valentine's
            > > day fell on. So...I declared an array and had it
            > find the day!!
            > > Mr. Vessell said I took the "easy" way out!!
            > > But gave me full credit because it worked!!
            > > He wanted me to use the switch method!!
            > > (Which is what he used in his example!!)
            > >
            > > I thought of this all on my own!!!!
            > > *Woo Hoo*
            > >
            >
            -----------------------------------------------------------------
            > >
            > > <html>
            > > <head>
            > > <title>Valentine's Day Script</title>
            > > </head>
            > > <body>
            > > <script language="JavaScript1.2">
            > > <!--
            > > var today=new Date();
            > > var Valentine=new Date(today.getFullYear(), 1,
            > 14);
            > > if(today.getMonth() == 1 && today.getDate() == 14)
            > > {
            > > alert("Today is Valentine's Day");
            > > }
            > > else
            > > if (Valentine < today)
            > > {
            > >
            > Valentine.setFullYear(Valentine.getFullYear() + 1);
            > > }
            > > var Difference=Valentine-today;
            > > var ValDay = Math.ceil(Difference/1000/60/60/24);
            > > document.write("There are " + ValDay + " days til
            > Valentine's Day")
            > > document.write("<br>")
            > > var day_names = new Array (7)
            > > day_names[0] = "Sunday"
            > > day_names[1] = "Monday"
            > > day_names[2] = "Tuesday"
            > > day_names[3] = "Wednesday"
            > > day_names[4] = "Thursday"
            > > day_names[5] = "Friday"
            > > day_names[6] = "Saturday"
            > >
            > > var day_name = day_names[Valentine.getDay()]
            > > document.write("Valentine's Day is " + day_name)
            > >
            > >
            > > //-->
            > > </script>
            > > </body>
            > > </html>
            > >
            > >
            > > [Non-text portions of this message have been
            > removed]
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > > Yahoo! Groups Links
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            >
            >
            >
            >
            >
            > YAHOO! GROUPS LINKS
            >
            > Visit your group "javascript_official" on the web.
            >
            > To unsubscribe from this group, send an email to:
            > javascript_official-unsubscribe@yahoogroups.com
            >
            > Your use of Yahoo! Groups is subject to the Yahoo!
            > Terms of Service.
            >
            >
            >
            >
            >
            >
            >
            > [Non-text portions of this message have been
            > removed]
            >
            >
            >
            >




            ____________________________________________________
            Start your day with Yahoo! - make it your home page
            http://www.yahoo.com/r/hs






            SPONSORED LINKS C programming language Computer programming languages Java
            programming language
            The c programming language C programming language Concept of programming
            language



            YAHOO! GROUPS LINKS

            Visit your group "javascript_official" on the web.

            To unsubscribe from this group, send an email to:
            javascript_official-unsubscribe@yahoogroups.com

            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.







            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.