fa977bb
Fix UUID messages unpack on demo playing - Kaffeine
cad00f7
Add a config var to toggle colors enablement for the console output - Kaffeine
57e16f3
CEntity: Make NetworkClipped() const - Kaffeine
d832800
Server: Implement a 'reason' argument for Console Shutdown - Kaffeine
9bfbad7
Merge #4431 - bors[bot]#!/bin/bash
shopt -s lastpipe; for l in `cut -d'|' -f2 "$1" | xargs | tr ' ' '\n'`; do [[ "2 4 3 7" =~ "${#l}" ]] && i=$((i+1)); done; echo $i
(edited)#!/bin/bash
# Advent of Code 9p1
shopt -s lastpipe
declare -A f
i=0
while read -r l; do
for j in {0..99}; do f[$i,$j]=${l:$j:1}; done
i=$((i+1))
done < "$1"
for i in {0..99}; do
for j in {0..99}; do
l=${f[$i,$j]}
if [ -z ${f[$((i-1)),$j]} ] || [[ ${f[$((i-1)),$j]} -gt $l ]]; then
if [ -z ${f[$((i+1)),$j]} ] || [[ ${f[$((i+1)),$j]} -gt $l ]]; then
if [ -z ${f[$i,$((j-1))]} ] || [[ ${f[$i,$((j-1))]} -gt $l ]]; then
if [ -z ${f[$i,$((j+1))]} ] || [[ ${f[$i,$((j+1))]} -gt $l ]]; then
[ -z $l ] && continue
a=$((a + l + 1))
fi
fi
fi
fi
done
done
echo $a