10 GOSUB 30
20 PRINT "20":RTN
30 PRINT "30":RTN
だと思っていたら
10 GOSUB 30
20 PRINT "20":RTN30 PRINT "30":RTN
| #!/bin/bash | |
| # displayplacerの出力を取得 | |
| list_output=$(displayplacer list) | |
| # 外部ディスプレイが接続されているか確認 | |
| if echo "$list_output" | grep -q "Type:.*external screen"; then | |
| echo "外部ディスプレイが接続されています。" | |
| else | |
| echo "外部ディスプレイが接続されていません。" |
| 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 # 摩擦係数 |
| 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 |