Skip to content

Instantly share code, notes, and snippets.

#include <bits/stdc++.h>
using namespace std;
// ackの計算(履歴保存)
int ack_calc(vector<vector<int>> &ack_process) {
int step = ack_process.size() - 1; // 現在のステップ数を求める
int depth = ack_process.at(step).size() - 1; // 再帰の深さ
if (depth == 0) {
return ack_process.at(step).at(0);
} else if (ack_process.at(step).at(depth - 1) == 0) { // m=0 のとき
linters: with_defaults(
line_length_linter(240),
commented_code_linter = NULL
)
@qwjyh
qwjyh / prime_number
Created July 31, 2021 06:55
aiscriptで素数を見つける
### {
name: "aiscript_prime"
version: 1.0
keywords: ["prime"]
}
for (#i, 100) {
$f <- no
$j <- 1
for (i) {
### Keybase proof
I hereby claim:
* I am qwjyh on github.
* I am qwjyh (https://keybase.io/qwjyh) on keybase.
* I have a public key ASCqPmgp_Iu0D4DgsptxxKtzGIVMpubUtIYtsTow7lq0gwo
To claim this, I am signing this object:
# 引数は1つのzipファイルに入れるファイル数
Param($package)
mkdir ..\zip
$items = Get-ChildItem
$i = 0
$j = 0
while ($i -le $items.count) {
Compress-Archive $items[$i..($i + $package)] ..\zip\zip_${j}.zip
$i = $i + $package
@qwjyh
qwjyh / triangle_mfm
Last active May 15, 2022 07:04
三角形を描くMFMを出力するAiScript
@concatStr(str1, str2){
`{str1}{str2}`
}
$content <- ""
$step <- 1
$steps <- 30
// 角度計算
@deg(stepn) {
@concatStr(str1, str2){
`{str1}{str2}`
}
$content <- ""
$step <- 1
$steps <- 30
// 角度計算
@deg(stepn) {
# g function for wsl/windows git
function g
if string match -rq '/mnt/*' $PWD
git.exe $argv
else
git $argv
end
end
@qwjyh
qwjyh / matrix_ptr.jl
Created June 29, 2022 09:48
get int** in julia
function ptrarray2d(src::Array{Int64, 2})
dst = Array{Ptr{Int64}}(undef, size(src, 1))
for i in 1:size(src, 2)
dst[i] = pointer(src[i,:])
end
dst
end
@qwjyh
qwjyh / mathemph.satyh
Created June 29, 2022 09:50
color in math
let-math \mathemph x =
let color-emph = Color.of-css `#7759b4` in
math-color color-emph x
in