GithubHelp home page GithubHelp logo

scalacenter / scala-advent-of-code Goto Github PK

View Code? Open in Web Editor NEW
52.0 9.0 64.0 52.79 MB

Scala Center's solution of Advent of Code

Home Page: https://scalacenter.github.io/scala-advent-of-code/

License: Apache License 2.0

Scala 100.00%
scala scalacenter advent-of-code-2021

scala-advent-of-code's Introduction

Scala Advent of Code 2023

Solutions in Scala for the annual Advent of Code challenge. Note: this repo is not affiliated with Advent of Code.

See earlier editions:

Website

The Scala Advent of Code website contains:

Setup

We use Visual Studio Code with Metals to write Scala code, and scala-cli to compile and run it.

You can follow these steps to set up your environement.

How to open in Visual Studio Code

After you clone the repository, open a terminal and run:

$ cd scala-advent-of-code
$ scala-cli setup-ide 2023
$ mkdir 2023/input
$ code 2023

code 2023 will open Visual Studio Code and start Metals. If not you may have to go to the Metals pane and click the button labelled "Start Metals".

When you navigate to a file, e.g. 2023/src/day01.scala metals should index the project, and then display code lenses above each of the main methods part1 and part2, as shown in this image:

To run a solution, first copy your input to the folder 2023/input. Then click run in VS Code which will run the code and display the results of the program. Or debug, which will let you pause on breakpoints, and execute expressions in the debug console.

How to run a solution with command line

In a terminal you can run:

$ scala-cli 2023 -M day01.part1
Compiling project (Scala 3.x.y, JVM)
Compiled project (Scala 3.x.y, JVM)
The solution is 64929

Or, to run another solution:

$ scala-cli 2023 -M <dayX>.<partX>

By default the solution programs run on our input files which are stored in the 2023/input folder. To get your solutions you can change the content of those files in the 2023/input folder.

Contributing

  • Please do not commit your puzzle inputs, we can not accept them as they are protected by copyright

scala-advent-of-code's People

Contributors

adpi2 avatar anatoliykmetyuk avatar bishabosha avatar eugeneflesselle avatar iusildra avatar julienrf avatar mbovel avatar merlinorg avatar mewencrespo avatar mlachkar avatar natsukagami avatar sethtisue avatar shardulc avatar sjrd avatar sporarum avatar stewsquared avatar tgodzik avatar vincenzobaz 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scala-advent-of-code's Issues

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.