This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <fstream> | |
| #include <sstream> | |
| int main() { | |
| std::ifstream file("input.txt"); | |
| std::string A, B, C, D, O; | |
| std::getline(file, A); | |
| std::getline(file, B); | |
| std::getline(file, C); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| input = document.querySelector('pre').innerText; | |
| [ranges, ids] = input.split('\n\n').map(x => x.split('\n')); | |
| ranges = ranges.map(r => r.split('-').map(x => parseInt(x))); | |
| console.log(ids.filter(id => ranges.some(r => id >= r[0] && id <= r[1])).length) | |
| function mergeRanges() { | |
| const N = ranges.length | |
| for (let i = 0; i < N; ++i) | |
| for (let j = 0; j < N; ++j) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string[] lines = File.ReadAllLines("input.txt"); | |
| int W = lines[0].Length, H = lines.Length; | |
| char[][] map = lines | |
| .Select(l => $".{l}.") | |
| .Prepend(new string('.', 2 + W)) | |
| .Append(new string('.', 2 + W)) | |
| .Select(l => l.ToCharArray()) | |
| .ToArray(); | |
| (int dx, int dy)[] NeighbourOffsets = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function joltage(line, n) | |
| local index = 1 | |
| local result = 0 | |
| for a = 1, n do | |
| local maxDigit = line:byte(index) | |
| for i = index, #line - (n - a) do | |
| if line:byte(i) > maxDigit then | |
| maxDigit = line:byte(i) | |
| index = i | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (module | |
| (import "sys" "open" (func $open (param i32 i32 i32 i32) (result i32))) | |
| (import "sys" "close" (func $close (param i32))) | |
| (import "sys" "read" (func $read (param i32 i32 i32) (result i32))) | |
| (import "sys" "write" (func $write (param i32 i32 i32) (result i32))) | |
| (memory (export "memory") 1) | |
| (data (i32.const 0) "input.txt") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (module | |
| (import "sys" "open" (func $open (param i32 i32 i32 i32) (result i32))) | |
| (import "sys" "close" (func $close (param i32))) | |
| (import "sys" "read" (func $read (param i32 i32 i32) (result i32))) | |
| (import "sys" "write" (func $write (param i32 i32 i32) (result i32))) | |
| (memory (export "memory") 1) | |
| (data (i32.const 0) "input.txt") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| default rel | |
| section .data | |
| filename: db "input.txt", 0 | |
| section .bss | |
| char: resq 1 | |
| number_string: resq 32 | |
| number: resq 1 | |
| isL: resq 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const multiplyMatrices = (A, B) => { | |
| return [ | |
| A[0]*B[0] + A[1]*B[1] + A[2]*B[2], | |
| A[3]*B[0] + A[4]*B[1] + A[5]*B[2], | |
| A[6]*B[0] + A[7]*B[1] + A[8]*B[2] | |
| ]; | |
| } | |
| const oklch2oklab = ([l, c, h]) => [ | |
| l, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>>,----------[--------------------------------------<[->>++++++++++<<]>[->+<]>[ | |
| -<<+>>]<,----------]<[[-<+>]>,----------[--------------------------------------< | |
| [->>++++++++++<<]>[->+<]>[-<<+>>]<,----------]<]<[<[->>+>+<<<]>>>[-<<<+>>>]<<[-> | |
| >+>+<<<]>>>[-<<<+>>>][-]>[-]>[-]+>[-]<<<<[>+>+<<-]>[<+>-]<<[>>+<<-]+>>>[>-]>[<<< | |
| <->>[-]>>->]<+<<[>-[>-]>[<<<<->>[-]+>>->]<+<<-][-]>[-]>[-]<<<[-][-]>[-]<<[>+>+<< | |
| -]>[<+>-]+>[<<<<[-]>[-<+>]>>->[-]]<[-]<<[-][-]>[-]>,----------[----------------- | |
| ---------------------<[->>++++++++++<<]>[->+<]>[-<<+>>]<,----------]<[[-<+>]>,-- | |
| --------[--------------------------------------<[->>++++++++++<<]>[->+<]>[-<<+>> | |
| ]<,----------]<]<][-]>[-]+>[-]+<[>[-<-<<[->+>+<<]>[-<+>]>>]++++++++++>[-]+>[-]>[ | |
| -]>[-]<<<<<[->-[>+>>]>[[-<+>]+>+>>]<<<<<]>>-[-<<+>>]<[-]++++++++[-<++++++>]>>[-< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| precision highp float; | |
| uniform mat4 projectionMatrix; | |
| uniform mat4 modelViewMatrix; | |
| uniform vec2 resolution; | |
| uniform float aspectRatio; | |
| uniform float u_time; | |
| uniform float u_shadow_power; | |
| uniform float u_darken_top; | |
| uniform vec4 u_active_colors; |