Solutions of Advent of Code 2021 in Rust, and some other languages.

Overview

advent-of-rust

Solutions of Advent of Code 2021 in Rust, and some other languages.

Puzzles

Puzzle Stars Languages
Day 1: Sonar Sweep Rust Python
Day 2: Dive! Rust
Day 3: Binary Diagnostic Rust Python
Day 4: Giant Squid Rust Python
Day 5: Hydrothermal Venture Rust Python
Day 6: Lanternfish Python
Day 7: The Treachery of Whales Rust
Day 14: Lanternfish Python
Comments
  • Modification de la CI

    Modification de la CI

    J'ai fait une fourchette du dépôt pour modifier l'intégration continue afin qu'elle vérifie correctement les défauts relevés par clippy. Jusqu'à maintenant, elle se contentait d'afficher des avertissements :stuck_out_tongue:

    J'ai aussi retiré les commandes qui venaient modifier la version de Rust. Comme ça, le résultat est plus consistant entre les exécutions, c'est une version 1.64.0 de Rust et c'est tout. J'ai donc corrigé les derniers défauts qui se sont déclarés entre la version de Rust que j'utilise 1.58.0 et celle de l'intégration continue

    opened by PierreGagelin 3
  • Fixed clippy without encapsulation

    Fixed clippy without encapsulation

    The for loop was taking ownership of the grid with an implicit call to "into_iter". Adding an explicit "iter_mut" fixed the ownership

    opened by PierreGagelin 3
  • Refactored 2022/day1 to easily add tests

    Refactored 2022/day1 to easily add tests

    Si ça ne te dérange pas, on partirait sur ce squelette pour la résolution. Il permet d'ajouter facilement des tests et tous les puzzles s'y adaptent bien :smile:

    Pour te motiver, je t'ai même donné une petite chips, regarde comment elle est belle ma résolution de partie 2 :wink:

    enhancement 
    opened by PierreGagelin 2
  • Added solution to puzzle 2015/day19

    Added solution to puzzle 2015/day19

    Hello, j'ai ajouté une solution à un puzzle de 2015. Elle est un peu bizarre parce qu'elle n'est théoriquement pas ce qui est demandé, mais elle fonctionne. Je te propose de l'essayer aussi pour voir ? La vraie solution me semble trop compliquée algorithmiquement. Elle part vite dans les choux parcequ'il y a trop de possibilité (ou alors j'ai loupé un truc). Le hic, c'est que du coup, les exemples de base ne fonctionnent pas (d'où les deux tests ignorés).

    J'ai pris la liberté de modifier la gestion du fichier d'entrée, je trouvais le code tout moche et pas pratique. Là c'est pratique pour faire des tests à la pelle en rajoutant des fichiers.

    J'ai aussi abandonné l'idée du fichier input.txt, vu que c'est censé être ton input de puzzle. Autant le laisser comme un test supplémentaire, non ? Mon input est en test05.txt par exemple.

    Idéalement, on ferait une librairie qui donne accès à une classe qui lit les fichiers d'entrée et donne un vecteur de strings. Je pense que c'est la même chose pour tous les problèmes.

    Sinon, c'est pas encore prêt à merger, je dois rajouter la documentation des petites étoiles

    opened by PierreGagelin 1
  • day11 in C++, for comparison - yuck

    day11 in C++, for comparison - yuck

    I tried to write the same program in C++ as much as I could, with the right types and some error checking.

    In C++ there are fewer checks, especially on integer arithmetics. You can mix unsigned/signed operands, different bit sizes, overflow, without any compiler complaint.

    The vector operator [] could segfault if the index is out of the limits.

    Moreover, in the solve inner loop (when the monkey throws items) if the input is not correctly chosen, we can stall in a forever ping-pong party. In Rust, the borrowing mechanism prevents this and forces developers to write their code differently.

    opened by rene-d 0
  • Updated README and files main documentation

    Updated README and files main documentation

    Mise à jour de la page README pour que les années 2015 et 2016 soient comme la 2021. J'en ai profité pour harmoniser la documentation en début de fichier.

    Est-ce qu'on peut virer les puzzles en Python quand ils sont fait en Rust ? Ils me font souvent chier quand je navigue et puis ça s'appelle advent-of-rust, pas advent-of-rust-and-sometimes-python. Mais si tu y tiens, on les laisse bien entendu :wink:

    opened by PierreGagelin 0
  • Clippy with pedantic option

    Clippy with pedantic option

    Clippy pedantic warnings have been fixed.

    When checking CI pipeline, we still see warnings because they come from the nightly version of rust toolchain. I'm using the rust toolchain coming along with Ubuntu 22.04 package repository (rust 1.58.1) :smile:

    opened by PierreGagelin 0
  • Fixed clippy with pedantic option for 2016

    Fixed clippy with pedantic option for 2016

    • fixed part1 of day5 challenge
    • fixed progress spinner display for day5 challenge, the tick is not supposed to be called when a steady tick is set. However it should not have messed the display
    • added a second test for day14 challenge, but commented it as it takes some time to complete
    • fixed day19 challenge when input has final newline
    • ran every test associated with the modified challenges (and those that use assembunny)
    opened by PierreGagelin 0
Owner
rene-d
Lex parsimoniae
rene-d
A library and tool for automata and formal languages, inspired by JFLAP

Sugarcubes is a library and application for automata and formal languages. It is inspired by JFLAP, and is intended to eventually to be an alternative to JFLAP.

Henry Sloan 22 Nov 2, 2022
An upper-level course for CS majors on formal languages theory and compilers.

CS4100 Introduction to Formal Languages and Compilers Spring 2022 An upper-level course for CS majors on formal languages theory and compilers. Topics

null 2 May 28, 2022
Frame is a markdown language for creating state machines (automata) in 7 programming languages as well as generating UML documentation.

Frame Language Transpiler v0.5.1 Hi! So very glad you are interested in Frame. Frame system design markdown language for software architects and engin

Mark Truluck 35 Dec 31, 2022
This is a 100% Rust bootloader for the nRF9160 microcontroller written for Dutch IoT Solutions

nRF9160 Bootloader for Dutch IoT Solutions This is a 100% Rust bootloader for the nRF9160 microcontroller written for Dutch IoT Solutions. Currently,

Tweede golf 4 Jul 14, 2022
A rust program to try and detect some types of Hardware Keyloggers.

Hardware Keylogger Detection Warning: Certain Types of Hardware keyloggers can not be detected by this program, Passive Hardware Keyloggers are imposs

null 4 Dec 5, 2022
Some tools for streaming frames to rpi-rgb-led-matrix using ZeroMQ, written in Rust.

led_matrix_zmq Some tools for streaming frames to rpi-rgb-led-matrix using ZeroMQ, written in Rust. This repository includes: Rust client and server l

Dan 2 Sep 6, 2022
Insert a new named workspace between two other named workspaces

Insert a new named workspace between two other named workspaces

null 2 Mar 13, 2022
TinyUF2 flash unlocker for STM32F411 (easily adaptable to other STM32F4xx)

TinyUF2 flash unlocker for STM32F411 (easily adaptable to other STM32F4xx) This small program is meant to unlock the first 2 (=32kb) flash sectors tha

Stefan Kerkmann 1 Feb 1, 2022
Application that simulates a large grid of Pokémon types fighting each other.

poke-fighting-rust Rust project that simulates a grid of Pokémon fighting with each other. Each Pokémon type is a pixel on the grid and is represented

Ólafur Waage 11 Dec 19, 2022
Uindex is a data store, for data that can be parsed as sentences in some context-free language.

Uindex - Universal index Uindex is a data store, for data that can be parsed as sentences in some context-free language.

Enrique Pérez Arnaud 3 Jul 20, 2021
Gathering some metrics about github projects

rust-metrics This is an experimental project to start gathering metrics about github organizations and repositories. The goal is to get an idea of var

null 51 Apr 9, 2022
Ointers is a library for representing pointers where some bits have been stolen so that they may be used by the programmer for something else

Ointers is a library for representing pointers where some bits have been stolen so that they may be used by the programmer for something else. In effect, it's a small amount of free storage

Irrustible 8 Jun 4, 2022
A CLI tool to convet Hex color code or RGB to color code, RGB, HSL and color name(if exists)

iro -色- A CLI tool to convert the hex color code or RGB to color code, RGB, HSL, color name(if exists, according to jonathantneal/color-names). Usage

Kyohei Uto 3 Dec 9, 2022
unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

unflow 是一个低代码、无代码设计语言。unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

Inherd OS Team (硬核开源小组) 70 Nov 27, 2022
A stupid macro that compiles and executes Rust and spits the output directly into your Rust code

inline-rust This is a stupid macro inspired by inline-python that compiles and executes Rust and spits the output directly into your Rust code. There

William 19 Nov 29, 2022
An implementation of Code Generation and Factoring for Fast Evaluation of Low-order Spherical Harmonic Products and Squares

sh_product An implementation of Code Generation and Factoring for Fast Evaluation of Low-order Spherical Harmonic Products and Squares (paper by John

Simon Brown 7 Dec 2, 2022
Source code and documentation for our 'full stack on rust' meetup on 29-9-2022

Full stack on Rust This is the code and documentation repository for our 'Full stack on Rust' meetup on 29-9-2022. It includes step-by-step documentat

Baseflow 7 Oct 23, 2022
A basic rp2040-hal project with blinky and rtt logging example code.

A basic rp2040-hal project with blinky and rtt logging example code. With this you can quickly get started on a new rp2040 project

rp-rs 202 Jan 6, 2023
proc macros for generating mut and non-mut methods without duplicating code

mwt Hey! You! Read this before using! mwt was thrown together pretty quickly for personal use, because I couldn't find an existing crate that does thi

null 1 Dec 24, 2021