Git Product home page Git Product logo

advent-of-code's Introduction

advent-of-code's People

Contributors

christopherbiscardi avatar ejplatzer avatar japz avatar korribanmaster avatar nvzqz avatar taurr avatar vv0jc13ch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

advent-of-code's Issues

Request: Use pest instead of nom in one of your videos

Hi,

First, thanks for doing the video series, I'm learning a lot!

When I started doing it (before I found your series), I knew I needed a parser, so did some Googling, and it seems that nom and pest are two of the more popular crates.

You have been doing a lot of nom, so I was wondering if you'd be willing to have a go with pest?

Cheers!

Please remove inputs from the repository

Hi,

Nice repository and great learning materials, while browsing the Repository I saw that you're including the AoC inputs in the code.

It is explicitly asked not to do this by the the creator here.

Best Regards

Question about nom

Hi!

Sorry to ask a question here but I'm become nuts.
Disclaimer: I'm a beginner with Rust.

In your example here you unwrap (it's the solution which work for me) and I need to do the same but I want to use ? operator instead but the compiler tell me bad things and I don't known how to fix that. So I found your github and... you unwrap too so I don't know how to handle the error because I want to do a library so I need to handle error.

My goal is to parse a string slice like 04:53:33,324 or 2:3:44,123 which represent hour:minute:second,millisecond (my end goal is to parse a srt file).

If you have some time for that, I will really appreciate your help and some explaination because nom is awesome but it's hard too.

#[derive(Debug)]
struct Time {
    hour: u8,
    // minute: u8,
    // second: u8,
    // millisecond: u16,
}

impl Time {
    fn parse(input: &str) -> IResult<&str, Self> {
        let (input, hour) = digit1(input)?;
        println!("{:#?}", hour);
        Ok((
            input,
            Time {
                hour: hour.parse::<u8>().unwrap(),
            },
        ))
    }
}

I want to handle the error if the input is alphabetic for example.

Thx.

Day 10 Part 2, bug?

I got stuck on part two for this problem, so I went to use your code as a reference. Updated my logic to match, which passes all the sample cases, however it does not work for my input data.

I then pulled your exact code and ran it on my input data and it does not work. I'm having trouble finding what the specific edge case is, but here is my input data https://gist.github.com/dmaahs2017/0f711278cd6a32e403c010a520f99285. The answer is not 444, answer too high.

I think this means there may be bug in your day10 part 2 solution, but you happened to get lucky with the input data not containing a particular edge case.

Running get-aoc-input.rs doesn't work

When trying to run the "just create day-01" command I got an error stating :

/usr/bin/env: ‘cargo +nightly -Zscript’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

Indeed, changing the line to

#!/usr/bin/env -S cargo +nightly -Zscript 

allowed it to work on my system.

Day 20. Variable equels 0

Hi, it looks like a bug

let added = index as i64 + current.1;

because in the example if you output line by line, then -2 will be at the beginning of the list after five iterations, in the example it is at the end

3 moves between 0 and 4:
1, 2, -2, -3, 0, 3, 4

-2 moves between 4 and 1:
1, 2, -3, 0, 3, 4, -2

if you add a check for 0 in the added variable and insert current at the end of the list, then everything will work too and the output from the example will match

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.