This file contains 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
from std/strutils import split, parseInt | |
from std/sequtils import map, foldl | |
let numbers = readLine(stdin).split(',').map(parseInt) | |
var buckets: array[9, int] | |
for number in numbers: | |
buckets[number] += 1 | |
for i in 0..<256: |
This file contains 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
from std/strutils import split, parseInt | |
from std/sequtils import map, foldl | |
let numbers = readLine(stdin).split(',').map(parseInt) | |
var buckets: array[256 + 9, int] | |
for number in numbers: | |
buckets[number] += 1 | |
for i in 0..<256: |
This file contains 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 getEventsCompanies() { | |
return fetch(`${baseUrl}/events/companies`).then((response) => response.json()); | |
} | |
function getEventsOther() { | |
return fetch(`${baseUrl}/events/other`).then((response) => response.json()); | |
} | |
function formatDateRange(start, end) { | |
const startMoment = moment(start); |
This file contains 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
/* Generated from day02.scm by the CHICKEN compiler | |
http://www.call-cc.org | |
Version 5.1.0 (rev 8e62f718) | |
linux-unix-gnu-x86-64 [ 64bit dload ptables ] | |
command line: day02.scm -output-file day02.c | |
uses: library eval expand extras data-structures | |
*/ | |
#include "chicken.h" | |
static C_PTABLE_ENTRY *create_ptable(void); |
This file contains 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
(import (chicken io)) | |
(import (chicken format)) | |
(import (chicken string)) | |
(import srfi-1) | |
(define (parse-line line) | |
(let ((words (string-split line))) | |
(list (car words) (string->number (car (cdr words)))))) | |
(define (parse inputs) |
This file contains 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
use core::fmt::Debug; | |
use std::{ | |
collections::{HashSet, VecDeque}, | |
io::BufRead, | |
}; | |
#[derive(PartialEq)] | |
enum Tile { | |
Nothing, | |
Wall, |
This file contains 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
let wasm; | |
const heap = new Array(32).fill(undefined); | |
heap.push(undefined, null, true, false); | |
function getObject(idx) { return heap[idx]; } | |
let heap_next = heap.length; |
This file contains 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
import fileinput | |
part1, part2 = 0, 0 | |
for line in fileinput.input(): | |
line = line.strip() | |
part1 += len(line) - len(eval(line)) | |
part2 += line.count("\\") + line.count('"') + 2 | |
print(part1, part2) |
This file contains 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
/* Generated by cobc 3.1.2.0 */ | |
/* Generated from day06b.cob */ | |
/* Generated at nov 06 2021 23:45:03 */ | |
/* GnuCOBOL build date Dec 24 2020 19:08:58 */ | |
/* GnuCOBOL package date Dec 23 2020 12:04:58 UTC */ | |
/* Compile command cobc -C day06b.cob */ | |
#include <stdio.h> | |
#include <string.h> | |
#define COB_KEYWORD_INLINE __inline |
This file contains 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
identification division. | |
program-id. day06. | |
data division. | |
working-storage section. | |
01 input-line pic x(100). | |
01 action pic x(10). | |
01 coords pic x(100). | |
01 start-coords pic x(100). |
NewerOlder