Giter Club home page Giter Club logo

advent-of-code-2023's Introduction

advent-of-code-2023

Advent of Code 2023 in CHICKEN Scheme (until I can't do it anymore and fallback to something nicer like C++)!

Lessons from each day

  • 01: Recursion makes my brain hurty
  • 02: defstruct is a life saver and slowly learning how to use the standard libs
  • 03: hash tables are in (srfi 69), and (chicken plist) is for (symbol value) list pairs. Also printf is cool
  • 04: Vectors are fixed length lists with $O(1)$ read write operations
  • 05: Life would be easier if you always treat ranges as (start, end) and not (start, length). Also why loop when you can (map)!
  • 06: (floor) and (ceiling) also do float to integer parsing, but then need to recover exactness with (inexact->exact). Also (map) accepts as many lists as function airity!
  • 07: (plist) is useful but the way you have to pass the symbol around instead of e.g. the list itself is counter-intuitive. Also I can't work out how to do if any on a list?
  • 08: (chicken irregex) are IrRegular Expressions, that are also constructed from s-expressions.
  • 09: (define ((curry f x) y) (f x y)) is chef's kiss. Also SRFI-1 has an every that does what I wanted with all/any!
  • 10: it might be better to use data structures instead of remembering if it's car or cdr next. Pick's Theorem is very cool!
  • 11: i didn't really learn anything new from this one
  • 12: memoization is easy but you need the egg. i can't work out a nice tail-call recursive pattern for solution though, since i need to (maybe) add the result to a variable (twice) and then return that

advent-of-code-2023's People

Contributors

fjebaker avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.