Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Christmas Cheer

The 'Advent of Code 2020' Event Begins (adventofcode.com) 26

"Need a vacation from 2020? Why not go on an adventure and learn programming at the same time?" asks developer Eric Wastl on Twitter, announcing this year's edition of the Advent of Code.

From the site: Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.

You don't need a computer science background to participate - just a little programming knowledge and some problem solving skills will get you pretty far. Nor do you need a fancy computer; every problem has a solution that completes in at most 15 seconds on ten-year-old hardware.

This discussion has been archived. No new comments can be posted.

The 'Advent of Code 2020' Event Begins

Comments Filter:
  • That was an interesting first challenge... I did it in Pascal... but the SQL entry seems to be the most oddball so far.

    • Hmm, I didn't get a sql question, I got a find the numbers that sum to 2020 question. Which I solved in the js console.
      • by pjt33 ( 739471 )

        GPP didn't say anything about the question being in SQL. Everyone saw the same problem: an SQL solution (which I'm sure will now be torn to pieces) would be (code and tt tags not supported, apologies for the proportional font):

        CREATE TEMP TABLE Entries (
        Val
        );

        INSERT INTO Entries VALUES (1721), (979), (366), (299), (675), (1456);

        SELECT x.Val * y.Val
        FROM Entries x INNER JOIN Entries y ON x.Val + y.Val = 2020 AND x.Val <= y.Val;

        Try it online [tio.run] with SQLite.

      • I'm guessing he means somebody solved it using SQL.

        I did it in Javascript, too.

        In an HTML page, just for a laugh. It's a good chance to practice other languages.

        • by ShanghaiBill ( 739463 ) on Tuesday December 01, 2020 @04:26AM (#60781522)

          I solved it with deep learning using Python, Tensorflow, and a cloud-based TPU instance. I generated a few million random pairs and trained the network using gradient descent back-propagation until I got a 95% positive on each input pair with a sum of 2020.

          • I got to this point, "To play, please identify yourself via one of these services: [GitHub] [Google] [Twitter] [Reddit]", saw that Slashdot was not an option, closed the browser tab, and opened another beer.
            • by G00F ( 241765 )

              They do seam least demanding that most services (checked each one) most websites when you use twiter, google, etc for authentication also have the ability to not only see everything public but also everything private and make changes. Take a look at this for example: https://api.twitter.com/oauth/... [twitter.com]

              Like this:

              • Follow and unfollow accounts for you.
              • Update your profile and account settings.
              • Post and delete Tweets for you, and engage with Tweets
              • posted by others (Like, un-Like, or reply to a Tweet, Retweet, etc

        • FTR, for anyone too retarded to do this in your js console, repl.it [repl.it] probably has your dumb ass covered.
    • by stevel ( 64802 )

      I plan to do these all in Fortran, as I did last year. Day 1 was easy.

  • Code sucks. Get over it.
  • This is a fun site. The first problem was trivial, but the site is a great source for interview questions. Everyone has Googled FizzBuzz already, so throwing a curveball with a less popular toy problem might be a good idea.

    • Always fun! Last year's processor simulation was great for us old hardware nerds.

      Haven't ever finished the whole series - the later puzzles get too time-consuming and my job doesn't stop. Still the first several days are great!

  • There were two solutions to part 2.

    That's the only interesting thing about day 1.

  • I can't find the solution widget to drag to the ship-it pane anywhere on the page? 2021 is the year of no-code right?

A complex system that works is invariably found to have evolved from a simple system that works.

Working...