Author Topic: Re: CODING CHALLENGE : A COUNTDOWN FOR NEW YEARS EVE 2020!  (Read 2382 times)

0 Members and 1 Guest are viewing this topic.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: CODING CHALLENGE : A COUNTDOWN FOR NEW YEARS EVE 2020!
« Reply #30 on: August 22, 2019, 10:09:31 am »
Hi Ashish. I use google translator and czech idnes.cz web for you:

Indeed, in our current and valid Gregorian calendar (introduced by Pope Gregory XIII in 1582), it is not strictly every four years. There are exceptions in which the gap between transmissions is eight years. These exceptions are in the round centuries, which are not multiples of 400. Thus, the years 1700, 1800, 1900, 2100, 2200 (and so on) were not or will not be leaps. For example, between 1896 and 1904, eight years passed between two February 29th. Conversely, there are direct multiples of 400, ie 1600, 2000, 2400 (and so on). This suggests that there are few people in this world who have experienced this exception in the past (most recently in 1900) and few have experienced this exception (not earlier than 2100). Feel free to teach your children that the leap year is every four years. This is true for us and for them.
Source: https://pavelmika.blog.idnes.cz/blog.aspx?c=248669

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: CODING CHALLENGE : A COUNTDOWN FOR NEW YEARS EVE 2020!
« Reply #31 on: August 22, 2019, 10:13:50 am »
I didn't knew this fact about leap year before. I was taught that when a year is divisible by 4 it is a leap year. Can anyone explain me what's the logic behind this?

Ah the problem is that the Earth does not revolve around the sun in a nice even integer amount of days, it is 365.25 - .0xxx so adding a day to the year every 4 years almost but does not quite even things up so every century we don't do that, still not quite perfect alignment, so every 4 centuries we don't do what we did do every century, sheez! lou-eez! still not right but pretty close! :D

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: CODING CHALLENGE : A COUNTDOWN FOR NEW YEARS EVE 2020!
« Reply #32 on: August 22, 2019, 10:20:55 am »
Petr, Bplus
Thank you for your explanation on this.
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: CODING CHALLENGE : A COUNTDOWN FOR NEW YEARS EVE 2020!
« Reply #33 on: August 22, 2019, 11:22:53 am »
Petr, Bplus
Thank you for your explanation on this.

And if that isn’t confusing enough for you, don’t forget the leap SECONDS...

https://en.m.wikipedia.org/wiki/Leap_second
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline petoro

  • Newbie
  • Posts: 27
    • View Profile
Re: CODING CHALLENGE : A COUNTDOWN FOR NEW YEARS EVE 2020!
« Reply #34 on: August 22, 2019, 12:00:10 pm »
And if that isn’t confusing enough for you, don’t forget the leap SECONDS...

https://en.m.wikipedia.org/wiki/Leap_second

But it seems that this is due to the tides, which  slow down a little bit the rotation of the earth. Then... every now and then, astronomers add a leap second.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: CODING CHALLENGE : A COUNTDOWN FOR NEW YEARS EVE 2020!
« Reply #35 on: August 22, 2019, 01:21:47 pm »
I believe that this qualifies (apart from the clock thing), and I claim the prize for shortest code - it'll be an all-expenses trip to Buenos Aires?

Code: QB64: [Select]
  1. IF VAL(RIGHT$(DATE$, 4)) < 2020 THEN PRINT "It'll be Some Time Before New Year's Day: Use Google to Give an Exact Time" ELSE PRINT "Happy New Year!"

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: CODING CHALLENGE : A COUNTDOWN FOR NEW YEARS EVE 2020!
« Reply #36 on: August 22, 2019, 01:35:44 pm »
LOL did dig in there and extract the essence! ;-))

Just getting the year like that did separate the before and the after quite nicely.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: CODING CHALLENGE : A COUNTDOWN FOR NEW YEARS EVE 2020!
« Reply #37 on: December 31, 2019, 07:52:13 pm »
Just thought I would remind some of you about this challenge a few months ago. :)