Skip to content

Instantly share code, notes, and snippets.

@kou029w
kou029w / 1本満足 vs 10本うまい棒.md
Last active November 20, 2016 12:06
1本満足 vs 10本うまい棒

1本満足 vs 10本うまい棒

      1本満足 うまい棒
商品名 1本満足バー シリアルチョコ うまい棒 チョコレート
単価(円) 100 10
本数 1 10
重さ(g) 37 90
カロリー(kcal) 189 450
満足
@kou029w
kou029w / stdin2factor.sh
Created January 18, 2017 11:23
stdin2factor.sh
#!/bin/bash
# while read i; do
# scr=`echo $i \
# | grep -oE [0-9]+ \
# | factor \
# | sed 's/ //;
# s/ /x/g;
# s/.*/s:&:;/'`
@kou029w
kou029w / factor.sh
Last active October 5, 2017 11:51
factor.sh
#!/bin/bash
# i=$1 p=${2:-2}
# while (( i != 1 )); do
# if (( i % p )); then
# (( p++ ))
# else
# echo $p
# (( i /= p, p = 2 ))
# fi
@kou029w
kou029w / bf.sh
Last active January 5, 2021 02:43
a brainfuck compiler written in bash
#!/bin/bash
grep -o . "$@"|sed '/\./cprintf 0x%x $((m[p]))|xxd -r
/\[/cwhile((m[p]));do
/]/cdone
/</c((p--))
/>/c((p++))
s/[+-]/((m[p]&&))/
/^.$/d'
@kou029w
kou029w / bf2kemono.sh
Last active February 8, 2017 16:42
create a kemono code that outputs a given brainfuck
#!/bin/bash
# なにこれなにこれ!
# https://github.com/consomme/kemono_friends_lang
s='s/>/たのしー:+/たーのしー:</すごーい:-/すっごーい:\[/うわー:]/わーい:\./なにこれなにこれ:,/おもしろーい:^.$//';grep -o . "$@"|sed "${s//:/!/;s/}"|tr -d \\n