Skip to content

Instantly share code, notes, and snippets.

View swawa-yu's full-sized avatar

swawa-yu swawa-yu

View GitHub Profile
@swawa-yu
swawa-yu / keidohu-sim.py
Created June 27, 2024 04:24
傾度風のシミュレーション(定常状態への収束・発散を調べる)
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
# 定数の定義
dt = 1 # タイムステップ
num_steps = 200 # ステップ数
pressure_gradient_force = np.array([0, 1.1]) # 気圧傾度力の大きさ(仮定)
coriolis_parameter = 1e-1 # コリオリ力の係数(仮定)
friction_coefficient = 0.0 # 摩擦係数
@swawa-yu
swawa-yu / IchigoJamで気をつけること.md
Created June 17, 2024 05:38
IchigoJamで気をつけること

行が折り返されているだけで、改行できていない

10 GOSUB 30
20 PRINT "20":RTN
30 PRINT "30":RTN

だと思っていたら

10 GOSUB 30
20 PRINT "20":RTN30 PRINT "30":RTN
open System.Linq
// aabbbcdddd -> [(a,2), (b,3), (c,1), (d,4)]
let runLength (s: string) =
let heads = { 1 .. s.Length - 1 }.Where(fun i -> s.[i - 1] <> s.[i]).Prepend(0).Append(s.Length).ToArray()
{ 0 .. heads.Length - 2 }.Select(fun i -> s.[heads.[i]], heads.[i + 1] - heads.[i]).ToArray()
// 使用例
input()
|> runLength
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
/*RULE
|0 -> nothing | 1 -> wall | 2 -> goal | 3 -> answer|
|0 -> 下 | 1 -> 右 | 2 -> 上 | 3 -> 左|
map