Skip to content

Instantly share code, notes, and snippets.

@maksverver
maksverver / PKGBUILD
Created February 9, 2023 21:51
Golly PKGBUILD without Perl support
View PKGBUILD
# Maintainer: Jake <aur@ja-ke.tech>
# Contributor: Kyle Sferrazza <kyle.sferrazza@gmail.com>
# Contributor: Maks Verver <maksverver@geocities.com>
# Contributor: p2k <Patrick.Schneider@uni-ulm.de>
# Contributor: nokangaroo <nokangaroo@aon.at>
pkgname=golly
pkgver=4.2
pkgrel=2
@maksverver
maksverver / PKGBUILD
Created February 7, 2023 20:09
syasokoban-2.0.2
View PKGBUILD
# Contributor: Franck Barbenoire <contact@franck-barbenoire.fr>
pkgname=syasokoban
pkgver=2.0.2
pkgrel=1
pkgdesc="Still Yet Another Sokoban"
arch=('i686' 'x86_64')
license=('GPL')
url="http://grayskygames.com/sokoban.html"
depends=('sdl')
@maksverver
maksverver / PKGBUILD
Created February 7, 2023 20:09
syasokoban-2.0.1
View PKGBUILD
# Contributor: Franck Barbenoire <contact@franck-barbenoire.fr>
pkgname=syasokoban
pkgver=2.0.1
pkgrel=2
pkgdesc="Still Yet Another Sokoban"
arch=('i686' 'x86_64')
license=('GPL')
url="http://grayskygames.com/sokoban.html"
depends=('sdl')
View Package.java
package com.janoz.aoc.y2022.day13;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public class Package implements Comparable<Package> {
private final AList contents;
View 13-optimized.py
from functools import cmp_to_key
import sys
def ParseLine(line):
stack = [[]]
i = 0
while i < len(line):
ch = line[i]
if ch.isdigit():
j = i + 1
@maksverver
maksverver / 13.py
Last active December 13, 2022 13:21
View 13.py
import sys
import json
def ParsePart(part):
a, b = part.splitlines()
return json.loads(a), json.loads(b)
pairs = list(map(ParsePart, sys.stdin.read().split('\n\n')))
View solve1.cc
#include <cassert>
#include <chrono>
#include <iomanip>
#include <iostream>
#include <vector>
#include <string>
namespace {
struct Point {
View gist:ebb4bc150f8dc6951b7ff5ca37edb65a
Monkey 0:
Starting items: 1
Operation: new = old * 3
Test: divisible by 2
If true: throw to monkey 1
If false: throw to monkey 2
Monkey 1:
Starting items: 1
Operation: new = old * 3
View Problem9.cpp.patch
--- a/Problem9/Problem9.cpp
+++ b/Problem9/Problem9.cpp
@@ -218,20 +218,19 @@ bool Run(const std::filesystem::path &file)
{
int d = dir;
Move lastMove;
- for (int k = 0; k < NumKnots /*&& d != None*/; k++)
+ for (int k = 0; k < NumKnots; k++)
{
auto& state = knotStates[k];
View oisyn.cc.patch
@@ -349,7 +350,8 @@
//int minx = 0, miny = 0, maxx = 0, maxy = 0;
BitGrid grid;
- int numCells = 0;
+ grid.Set(0, 0);
+ int numCells = 1;
while (ptr < end)
{