November 18, 2019, 07:45:18 pm

News:

Juju thinks he's so clever by putting funny stuff here


The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

Advent of Code

Started by Ivoah, December 03, 2015, 03:03:24 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ivoah

December 03, 2015, 03:03:24 am Last Edit: December 09, 2015, 01:59:41 pm by Ivoah
flyingfisch posted this link in #omnimaga and I thought y'all might like it: http://adventofcode.com/

I'm going to try to do all of them on the right days, but I dunno if I'll have the time. Post your solutions to the problems in the thread. I'll update this post as I solve the puzzles

Instead of updating this post whenever I finish a new puzzle, I've put them all in a github repo: https://github.com/Ivoah/AdventofCode

Juju

Oh, nice, I'm gonna try that.
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron



if you wanna throw money at me and/or CodeWalrus monthly it's here

DJ Omnimaga

Not sure if I will participate, since I have no clue what it involves (although I assume you must write code for daily problems that are posted there?), but this is what I get when logging in from Twitter:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Ivoah

Quote from: DJ Omnimaga on December 03, 2015, 05:27:04 pm
Not sure if I will participate, since I have no clue what it involves (although I assume you must write code for daily problems that are posted there?), but this is what I get when logging in from Twitter:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



It's like an advent calendar, but instead of little gifts, it has little programming puzzles to solve. Also, I don't know why it's not working for you :( It works just fine for me.

DJ Omnimaga

Ah I see, thanks for explaining. There was literally no explanation on the pages I could access.

Juju

Works fine for me as well. The 2nd part of Day 3 was kinda hard for some reason.
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron



if you wanna throw money at me and/or CodeWalrus monthly it's here

Ivoah

Quote from: Juju on December 03, 2015, 05:46:03 pm
Works fine for me as well. The 2nd part of Day 3 was kinda hard for some reason.


I only had to add 4 lines and change 1, so it was pretty easy for me :)

Juju

Woo, I managed to get on the leaderboard for today :3 I lost some time due to a wrong answer and some stupid stuff I was doing in my code, but still.

Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron



if you wanna throw money at me and/or CodeWalrus monthly it's here

DJ Omnimaga

Oh nice Juju. I hope you can get higher :D. Good luck everyone :)

Juju

December 04, 2015, 05:29:48 am #9 Last Edit: December 04, 2015, 05:31:47 am by Juju
Heh, I'll try tomorrow xD

In short you have to be online at exactly midnight EST and be in the 100 first people who finished every puzzle before to finish today's puzzle. As in, currently, before 0:15. That's some serious speedcoding here xD
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron



if you wanna throw money at me and/or CodeWalrus monthly it's here

Adriweb

December 04, 2015, 09:14:22 am #10 Last Edit: December 05, 2015, 05:58:58 am by Adriweb
I should probably get interested in completing the challenges as soon as they appear, since I just made the 4th one in, like, a minute, in PHP.
Spoiler: ShowHide
$i = 0;
while (strpos(md5('ckczppom' . ++$i), '00000') !== 0);
echo $i;


Sounds fun :)
Co-founder & co-administrator of TI-Planet and Inspired-Lua

Ivoah

I finished Day 4 in bed on my iPad :D

DJ Omnimaga



Adriweb

December 05, 2015, 05:36:34 am #14 Last Edit: December 05, 2015, 07:50:49 am by Adriweb
Made it on the leaderboard today (54th), but next time I'll make sure to correctly read all the rules, because I lost around 2 minutes because of a stupid mistake :P

Spoiler: ShowHide
    $total = 0;
    foreach(file('day_5.txt') as $line)
    {
        if ( (1 === preg_match('/(.*[aeiou].*){3}/', $line))
          && (1 === preg_match('/(.)\\1/', $line))
          && (1 !== preg_match('/(ab|cd|pq|xy)/',$line)) )
        {
            $total++;
        }
    }
    echo $total . "\n";

    $total = 0;
    foreach(file('day_5.txt') as $line)
    {
        if ( (1 === preg_match("/(..).*\\1/", $line))
          && (1 === preg_match("/(.).\\1/", $line)) )
        {
            $total++;
        }
    }
    echo $total . "\n";


Also, I like the top 1's solution I should have thought of using grep piping directly, it really was the right tool for the job!
Co-founder & co-administrator of TI-Planet and Inspired-Lua

Powered by EzPortal