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
# Contributor: Franck Barbenoire <[email protected]> | |
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') |
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
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; |
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 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 |
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 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'))) | |
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
#include <cassert> | |
#include <chrono> | |
#include <iomanip> | |
#include <iostream> | |
#include <vector> | |
#include <string> | |
namespace { | |
struct Point { |
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
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 |
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
--- 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]; |
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
@@ -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) | |
{ |
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
#include <algorithm> | |
#include <cassert> | |
#include <cstdint> | |
#include <cstdio> | |
#include <iostream> | |
#include <map> | |
#include <mutex> | |
#include <string> | |
#include <thread> | |
#include <utility> |
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
#include <algorithm> | |
#include <cassert> | |
#include <cstdint> | |
#include <cstdio> | |
#include <iostream> | |
#include <string> | |
#include <utility> | |
#include <vector> | |
namespace { |