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
<?xml version="1.0" ?> | |
<xsl:stylesheet | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:cd="http://www.gnucash.org/XML/cd" | |
xmlns:book="http://www.gnucash.org/XML/book" | |
xmlns:gnc="http://www.gnucash.org/XML/gnc" | |
xmlns:cmdty="http://www.gnucash.org/XML/cmdty" | |
xmlns:trn="http://www.gnucash.org/XML/trn" | |
xmlns:split="http://www.gnucash.org/XML/split" | |
xmlns:act="http://www.gnucash.org/XML/act" |
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
#!/bin/bash | |
set -eu | |
IFS=, read -r -a ram < "$1" | |
getval() { | |
case $1 in | |
0) echo "${ram[$2]}" ;; | |
1) echo "$2" ;; |
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
#!/bin/bash | |
set -eu | |
set -o pipefail | |
xorigin=1000 | |
yorigin=1000 | |
wires=() |
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
#!/bin/bash | |
set -eu | |
set -o pipefail | |
orrery=/dev/shm/orrery | |
cd "$(dirname "$0")" | |
rm -rf "$orrery" | |
mkdir "$orrery" |
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
#!/bin/bash | |
set -eu | |
set -o pipefail | |
orrery=/dev/shm/orrery | |
rm -rf "$orrery" | |
mkdir "$orrery" |
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
#!/bin/bash | |
set -eu | |
getval() { | |
case $1 in | |
0) echo "${ram[$2]}" ;; | |
1) echo "$2" ;; | |
esac | |
} |
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
#!/bin/bash | |
# This program has some kind of deadlock/race condition | |
# There are some hacks to let you rerun it and make continual progress so you can: | |
# while true; do ./7.sh input & sleep 10; kill %1; done | |
set -eu | |
getval() { | |
case $1 in |
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
#!/bin/bash | |
set -eu | |
input=$(<"$1") | |
layers=() | |
width=25 | |
height=6 | |
area=$((width * height)) |
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
#!/bin/bash | |
set -eu | |
set -o pipefail | |
input=$1 | |
width=$2 | |
height=$3 | |
cd "$(dirname "$0")" |
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
#!/bin/bash -eu | |
declare -ai program ram | |
declare -i addrmode1 addrmode2 arg1 arg2 pc=0 rb=0 | |
IFS=, read -r -a program < "$1" | |
shift | |
inputs=("$@") | |
ram=("${program[@]}") | |
ops=(x '+' '*' x x '-eq' '-ne' '<' '==') | |
while : ; do |
OlderNewer