‌

Share your progress on Instagram under #bauhausadventcoding!

Welcome to the Bauhaus Advent Coding Challenge!

Link Copied!

Event Start:

This is a coding event hosted by students of the Bauhaus-University. You can prove your problem solving skills in coding puzzles over several days of December! From Wednesday December 3st till Sunday 21st, every three days at 5pm a new puzzle will be unlocked in this calendar. Write a program to solve them the fastest and compete on the leaderboard to climb the ranks! And perhaps there will even be a little surprise for the top three.

How to participate?

Pick your favorite programming language and get started! These puzzles are designed to be solvable in any language. Just log in with your Gitlab, Github or Google account and grab your personalized puzzle input from the calendar's puzzle page.

Curious about visualizing even the most complex scientific data? Check out the Computer Science study program at Bauhaus-University !

Game Rules

At 5pm of the day, a Christmas bauble will unlock (click on the Christmas tree). Behind it you will find a description to a puzzle and a link to download your puzzle input in text form. Solve the puzzle by computing a single number or single word from your input the description asks for. Submit your answer with the "Submit" button and the page will tell you if your answer was correct or not. You can try as many times as you want, but you'll have to wait a short time between attempts.

A puzzle always has 2 parts. After finding the first answer, you unlock the second half of the puzzle. The input stays the same, but second the description will ask for a slightly different approach to compute an answer. Once you have completed the two answers, you are done!

Each user gets a different puzzle input! So there is no point in cheating by copying the answer from a friend.

The Leaderboard

For every right answer, you'll receive points. The 1st person to get the right answer to a puzzle receives 100 points, the 2nd one 99 and so on. Everyone after the first 100 people gets 0 points. So at each day you can get a maximum of 200 points.

At the end of December the three people with the highest scores will be selected as winners and will be contacted by email to to receive their prizes!

Getting Started (Snippets)

If you aren't sure about how to get started coding, here are example snippets in different languages. They show how to read in your puzzle input from a saved .txt file:

def parse_input(path: str) -> list[str]:
	with open(path, 'r', encoding='utf-8') as f:
		lines = f.read().splitlines()
	return lines

def main():
	lines = parse_input("day1-input.txt")
	for line in lines:
		print(line)
		# your puzzle solution here

if __name__ == "__main__":
	main()
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

public class Day1 {
	public static List<String> parseInput(String path) {
		try {
			return Files.lines(Paths.get(path), StandardCharsets.UTF_8).toList();
		} catch (IOException e) {
			System.out.println("File not found: " + path);
			System.exit(1);
			return null;
		}
	}

	public static void main(String[] args) {
		List<String> text = parseInput("day1-input.txt");

		for (String line : text) {
			System.out.println(line);
			// your puzzle solution here
		}
	}
}
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <locale>
#include <codecvt>

std::vector<std::string> parseInput(const std::string& path) {
	std::ifstream file(path, std::ios::binary);
	std::vector<std::string> lines;

	if (!file.is_open()) {
		std::cerr << "File not found: " << path << std::endl;
		return lines;
	}
	file.imbue(std::locale(file.getloc(), new std::codecvt_utf8<char>));
	std::string line;

	while (std::getline(file, line)) {
		lines.push_back(line);
	}
	return lines;
}

int main() {
	std::vector<std::string> lines = parseInput("day1-input.txt");

	for (const auto& line : lines) {
		std::cout << line << std::endl;
		// your puzzle solution here
	}
}
package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
)

func parseInput(filename string) ([]string, error) {
	file, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer file.Close()
	var lines []string
	scanner := bufio.NewScanner(file)

	for scanner.Scan() {
		lines = append(lines, scanner.Text())
	}
	if err := scanner.Err(); err != nil {
		return nil, err
	}
	return lines, nil
}

func main() {
	lines, err := parseInput("day1-input.txt")

	if err != nil {
		log.Fatalf("Error reading file: %v", err)
	}
	for _, line := range lines {
		fmt.Println(line)
		// your puzzle solution here
	}
}
use std::fs::File;
use std::io::{self, BufRead};
use std::path::Path;

fn parse_input(path: &str) -> io::Result<Vec<String>> {
    let file = File::open(path)?;
    let lines = io::BufReader::new(file)
        .lines()
        .collect::<Result<_, _>>()?;
    Ok(lines)
}

fn main() -> io::Result<()> {
    let lines = parse_input("day1-input.txt")?;
    for line in lines {
        println!("{}", line);
        // your puzzle solution here
    }
    Ok(())
}

Good Luck and Have Fun!