Skip to content

Instantly share code, notes, and snippets.

@ryu10
ryu10 / niflheimstrout.py
Last active July 3, 2025 03:04
反動のゲームちゃんねる「ニフルハイムのユリ 04」(2025/7/1)サンショウウオの問題
# 「ニフルハイムのユリ」サンショウウオの問題
# 最終局面から逆算する
# おいら:金の魚 6 匹
metrout = ["金", "金", "金", "金", "金", "金"]
# アニキ:灰色の魚 6 匹
brostrout = ["灰", "灰", "灰", "灰", "灰", "灰"]
loc = 0
result = ""
@ryu10
ryu10 / sfbajmc.scad
Last active July 2, 2025 16:20
SF Bay Area Japan Maker Community のメイカーチップ
filament_white = true;
filament_black = true;
filament_magenta = true;
filament_yellow = true;
$nf = 50;
// Color Scheme
// - Orange: yellow on magenta
@ryu10
ryu10 / frieren.py
Last active May 19, 2025 18:16
「葬送のフリーレン」公式アカウントのダジャレが過ぎるので先回りして網羅する
# -*- coding: utf-8 -*-
#「葬送のフリーレン」公式アカウントのダジャレが過ぎるので先回りして網羅する
import sys
args = sys.argv
n_best = 4
if len(args) > 1:
if args[1].isdigit:
n_best = int(args[1])
@ryu10
ryu10 / HATGFX.bas
Last active June 25, 2024 12:09
Plot Z = 100 * COS(R) - 40 * COS(3 * R) in Applesoft Basic
10 HGR
20 DIM D(160): FOR I = 1 TO 159:D(I) = 100: NEXT
22 DR = 3.14/180
30 FOR Y = -180 TO 180 STEP 6
40 FOR X = -180 TO 180 STEP 4
50 R = DR * SQR(X *X +Y *Y)
60 Z = 100 * COS(R) -40 * COS(3 *R)
70 SX = INT(80 +X/3 -Y/6)
80 SY = INT(40 -Y/6 -Z/4)
90 IF (SX <0) +(SX > = 160) THEN 110
@ryu10
ryu10 / sim.sh
Created April 28, 2024 04:13
Icarus Verilog sim execution script for oneshottmr.v
TOP_MODULE=oneshottmr_sim
OUT_FILE=test.out
# compile
iverilog -g2012 \
-o ${OUT_FILE} \
-s ${TOP_MODULE} ./scenario.sv ../src/oneshottmr.v
# ./oneshottmr_orig.v
# ../src/oneshottmr.v
@ryu10
ryu10 / scenario.sv
Created April 28, 2024 04:12
Icarus Verilog scenario file for oneshottmr.v
//////////////////////////////////////////////////////////////
// module :oneshottmr_sim
/////////////////////////////////////////////////////////////
`timescale 1ns/1ps
module oneshottmr_sim;
// Create clock
parameter CLK_E_1MHz = 1000; // ns
@ryu10
ryu10 / oneshottmr.v
Created April 28, 2024 03:28
Assist09 PTM one-shot timer
// Verilog one-shot counter module
module oneshottmr
(
input clk,
input reset_n,
input trigger,
output reg q_n
);
@ryu10
ryu10 / leap-keyboard-layout-r2.json
Last active June 21, 2024 18:08
Leap Keyboard layout
[
[
{
"t": "#000000\n\n#0a0000"
},
"o\n+/-\nPara\nSS\nL MGN",
{
"t": "#000000",
"a": 5
},
{
Online Pascal Compiler.Code, Compile,
Run and Debug Pascal program online.Write your code in this editor and
press "Run" button to execute it.}
program asciiart;
var
x, y, i, i2, flag:integer;
@ryu10
ryu10 / h2b.patch
Last active May 24, 2023 15:51
hex2bin patch on libcrc.h Makefile common.h
--- hex2bin/libcrc.h 2023-05-21 01:35:20.711215991 +0100
+++ hex2bin.new/libcrc.h 2023-05-21 01:21:23.359661817 +0100
@@ -24,7 +24,7 @@
#ifndef _LIBCRC_H_
#define _LIBCRC_H_
-void *crc_table;
+extern void *crc_table;
void init_crc8_normal_tab(uint8_t polynom);