You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

Advent of Code

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

0
b/PC, Mac & Vintage Computers publicado por u/Ivoah December 03, 2015, 03:03:24 AM
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
Last Edit: December 09, 2015, 01:59:41 PM by Ivoah
Inicia sesión o crea una cuenta para dejar un comentario
u/Yuki December 03, 2015, 03:17:53 AM
Oh, nice, I'm gonna try that.
u/Dream of Omnimaga 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, webmaster@localhost 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.
u/Ivoah December 03, 2015, 05:32:07 PM
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, webmaster@localhost 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.
u/Dream of Omnimaga December 03, 2015, 05:45:13 PM
Ah I see, thanks for explaining. There was literally no explanation on the pages I could access.
u/Yuki 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.
u/Ivoah December 03, 2015, 05:47:17 PM
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 :)
u/Yuki December 04, 2015, 05:24:55 AM
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.

u/Dream of Omnimaga December 04, 2015, 05:25:25 AM
Oh nice Juju. I hope you can get higher :D. Good luck everyone :)
u/Yuki December 04, 2015, 05:29:48 AM
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
Last Edit: December 04, 2015, 05:31:47 AM by Juju
u/Adriweb December 04, 2015, 09:14:22 AM
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
$i = 0;
while (strpos(md5('ckczppom' . ++$i), '00000') !== 0);
echo $i;

Sounds fun :)
Last Edit: December 05, 2015, 05:58:58 AM by Adriweb
u/Ivoah December 04, 2015, 01:08:42 PM
I finished Day 4 in bed on my iPad :D
u/Dream of Omnimaga December 04, 2015, 07:30:49 PM
You coded while asleep? O.O
u/Ivoah December 05, 2015, 03:42:13 AM
Quote from: DJ Omnimaga on December 04, 2015, 07:30:49 PM
You coded while asleep? O.O

I'm just that good ;)
u/Adriweb December 05, 2015, 05:36:34 AM
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
    $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!
Last Edit: December 05, 2015, 07:50:49 AM by Adriweb
Start a Discussion

b/PC, Mac & Vintage Computers

Computer programming discussion and project showcase

132
Topics
Explore Board
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal