Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am soyoil on github.
  • I am soyoil (https://keybase.io/soyoil) on keybase.
  • I have a public key whose fingerprint is B17C EFF3 737B AA2A 1D0F 4F57 C823 B98C D9A2 A8A1

To claim this, I am signing this object:

@soyoil
soyoil / clock.c
Created July 9, 2021 06:29
Cによるアナログ時計
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define SIZE 40
void set(char *buf, int x, int y, char c) {
x += SIZE;
@soyoil
soyoil / digraphgen.py
Created January 12, 2021 10:02
隣接行列から有向グラフを作成する
import numpy as np
import networkx as nx
w = np.array([
[ 0, 0, 0, 8, 15, 0],
[10, 0, 24, 0, 8, 0],
[ 0, 0, 0, 0, 0, 6],
[ 0, 0, 0, 0, 5, 0],
[ 0, 0, 12, 0, 0, 7],
[ 0, 0, 3, 0, 0, 0]
@soyoil
soyoil / reportgen.sh
Created December 13, 2020 15:35
レポートを生成するスクリプト(完全に自分用)
#!/bin/sh
CMD=$0
if [ $# -ne 1 ]; then
echo "Usage: ${CMD##*/} file"
exit 1
fi
cat $PWD/$1 | pandoc $FILEPATH \
-N \
@soyoil
soyoil / gbnoise.py
Last active September 18, 2020 16:11
ゲームボーイのノイズ音源の波形を表示するガバガバプログラム
import numpy as np
import matplotlib.pyplot as plt
def noize(shortFreq):
reg = 0xffff
output = 1
fre = list()
for i in range(300):
if(reg == 0):
reg = 1
@soyoil
soyoil / gbcal.z80
Created September 3, 2020 09:36
ゲームボーイでカレンダーを表示してみる試み
include "hardware.inc"
section "halt", rom0[$38]
di
halt
stop
section "lcdc status interrupt", rom0[$48]
reti
section "serial interrupt", rom0[$58]
reti