Share Code Quickly

What is Harigami?

Harigami is a simple source code sharing service. You can share source code by an URL which is issued after submission.
You can also run your source code online such as Python, Ruby, JavaScript and so on.
For free.Use for code review.
Preferences
anonymous No title
VBA
Private Sub VBA100Answer004()

Dim ws As Worksheet: Set ws = ActiveSheet
Dim lastrow As Long: lastrow = Cells(Rows.Count, 1).End(xlUp).Row  '最終行
Dim lastcol As Long: lastcol = Cells(1, Columns.Count).End(xlToLeft).Column  '最終列

'最終行と最終列を取得
'B2を起点にする
'最終行と最終列には数式が入っているのでマイナス1する

ws.Range(Cells(2, 2), Cells(lastrow - 1, lastcol - 1)).ClearContents

End Sub
anonymous No title
CSS
html::-webkit-scrollbar, #copy-element::-webkit-scrollbar {
    width: 13px;
    height: 13px;
}

html::-webkit-scrollbar-thumb, #copy-element::-webkit-scrollbar-thumb {
    background-color: #bbb5eb;
    border-radius: 8px;
}

html::-webkit-scrollbar-track, #copy-element::-webkit-scrollbar-track {
    background: #f6f2e9;
}
anonymous No title
Shell
Set-PSReadLineOption -EditMode Emacs
Set-PSReadLineKeyHandler -Key Ctrl+j -Function AcceptLine
Set-PSReadLineKeyHandler -Key Ctrl+o -Function BackwardWord
Set-PSReadLineKeyHandler -Key Ctrl+f -Function ForwardWord
Set-PSReadLineKeyHandler -Key Ctrl+l -Function ForwardChar
Set-PSReadLineKeyHandler -Key Ctrl+w -Function BackwardDeleteWord
Set-PSReadLineKeyHandler -Key Ctrl+s -Function BackwardChar
Set-PSReadLineKeyHandler -Key Ctrl+k -Function DeleteEndOfWord

Set-PSReadLineKeyHandler -Key Ctrl+i -Function MenuComplete
# Set-PSReadLineKeyHandler -Key Ctrl+i -Function Complete
# Set-PSReadLineKeyHandler -Key Ctrl+i -Function TabCompleteNext

Set-PsFzfOption -PSReadlineChordProvider       'Ctrl+t'
Set-PsFzfOption -PSReadlineChordReverseHistory 'Ctrl+r'

function prompt() {
  (Split-Path (Get-Location) -Leaf) + "> "
}
# Set-PSReadlineOption -TokenKind Parameter -ForegroundColor Red
# Set-PSReadlineOption -TokenKind Command -ForegroundColor Red


Set-Alias vim nvim
Set-Alias vi  nvim

Set-Alias ll  ls

function l(){
  Get-ChildItem -Name
}

Set-Alias open explorer

function sh(){
  powershell -F
}

# Expand-Archive -Path $zip -DestinationPath $dir1 -Force


cd ~/Downloads
anonymous No title
Python
import json
import re
from pprint import pprint

# MEMO
# CapsLock → F21
# F21 → 132


def configure(keymap):
    # *---jsonファイルの読み込み
    with open('keymaps.jsonc', encoding="utf-8") as f:
        raw_data = f.read()
    raw_data_comments_ignored = re.sub(r'/\*[\s\S]*?\*/|//.*', '', raw_data)

    df :dict = json.loads(raw_data_comments_ignored)
    modifiers :dict = df["modifier"]
    hotkeys :dict = df["hotkeys"]


    # *---Modifierの設定
    for key, value in modifiers.items():
        keymap.defineModifier(key, value)


    # *---hotkeyの設定
    keymap_global = keymap.defineWindowKeymap()

    def blind(key :str, value :str) -> None:
        default_modifiers_list = ("", "S-", "C-", "C-S-", "A-", "A-S-", "A-C-", "A-C-S-", "W-", "W-S-", "W-C-", "W-C-S-", "W-A-", "W-A-S-", "W-A-C-", "W-A-C-S-")
        for modifier in default_modifiers_list:
            keymap_global[modifier + key] = modifier + value

    def send(key: str, value: str) -> None:
        keymap_global[key] = value

    for genre in hotkeys.keys():
        for key, value in hotkeys[genre].items():
            if genre == "IME":
                send(key, value)
            else:
                blind(key, value)

anonymous No title
C
#include"DxLib.h"


int st2std[10],st2stdl[10],st2wk2[12],st2wk2l[12];
//移動の際使う
int x, y;
//iとmでアニメーションの周期速度調整
int  i = 0, m = 0,P=0,Q=0;
//向き muki>=0右 muki<0左
int muki;
//初期位置
int shokix = 50, shokiy = 320;
//当判定    左上xy,右下xy
int at[4] = {17,18,42,45};
int AT[4];
//重力
int GPOWER;
//自機画像左上のポイント
int Yzah, Xzah;
//接地している場合0 していない場合1 ※考え中
int setti=0;



int st[];

void st2stdrv();
void st2stdlv();
void st2wk2rv();
void st2wk2lv();
void zahyou();
void jump();
void gravity();
void stage0();
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen(DX_SCREEN_BACK);
	

	//右向き
	muki = 0;
	//↓画像10分割,横5分割,縦2分割,一つの横サイズ63,一つの縦サイズ48,代入する変数
	LoadDivGraph("画像/style2-stand.png",10,5,2,63,48,st2std);
	LoadDivGraph("画像/style2-standl.png", 10, 5, 2, 63, 48, st2stdl);
	LoadDivGraph("画像/st2-walk2.png", 12, 6, 2, 63, 48, st2wk2);
	LoadDivGraph("画像/st2-walk2l.png", 12, 6, 2, 63, 48, st2wk2l);
	while (ScreenFlip() == 0 && CheckHitKey(KEY_INPUT_ESCAPE) == 0 && ProcessMessage() == 0 && ClearDrawScreen() == 0) {
		
		Xzah = x + shokix;
		Yzah = y + shokiy;

		if (CheckHitKey(KEY_INPUT_0))zahyou();
		

		if(muki>=0)st2stdrv();
		if (muki < 0)st2stdlv();
		// ボックスの左上[移動先(x)+初期位置(50)+当たり判定X座標左上(17)]                                   FALSE= 塗りつぶしなし
	
		if (CheckHitKey(KEY_INPUT_RIGHT))st2wk2rv();
		if (CheckHitKey(KEY_INPUT_LEFT))st2wk2lv();
		//if (CheckHitKey(KEY_INPUT_UP))y=y--;
		//if (CheckHitKey(KEY_INPUT_DOWN))y=y++;
		//ジャンプ上昇
		if (CheckHitKey(KEY_INPUT_SPACE))jump();
		//ジャンプからボタンを離すとゆるやかに数字が下降
		if (CheckHitKey(KEY_INPUT_SPACE) == 0)Q--, gravity();
		//Qがマイナスにならないよう処理
		if (Q < 0)Q = 0;
		//座標表示
		if (CheckHitKey(KEY_INPUT_Q))zahyou();

		
		stage0();
		

		DrawFormatString(10, 25, GetColor(255, 255, 255), "Q=%d", Q);
		DrawFormatString(10, 65, GetColor(255, 255, 255), "Y座標=%d", Yzah);
		DrawFormatString(10, 80, GetColor(255, 255, 255), "X座標=%d", Xzah);
		DrawFormatString(10, 115, GetColor(255, 255, 255), "GPOWER=%d", GPOWER);

		DrawFormatString(10, 150, GetColor(255, 255, 255), "at[0]=%d", at[0]);
		DrawFormatString(10, 165, GetColor(255, 255, 255), "y=%d", y);
		DrawFormatString(10, 200, GetColor(255, 255, 255), "x=%d", x);
		DrawFormatString(10, 215, GetColor(255, 255, 255), "shokiy=%d", shokiy);
		DrawFormatString(10, 230, GetColor(255, 255, 255), "shokix=%d", shokix);

		

	}
	DxLib_End();
	return 0;
}
void st2stdrv() {
	//立ち状態右向き
	DrawFormatString(100, 170, GetColor(255, 255, 255), "i=%d,m=%d", i, m);
	DrawGraph(x + shokix, y + shokiy, st2std[i], TRUE);
	
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	//自機の白い四角
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);
	//自機の足元ピンク
	DrawLine(x + shokix + at[0], y + shokiy + at[3], x + shokix + at[2] , y + shokiy + at[3], GetColor(255, 0, 255));
	
}
void st2stdlv() {
	//立状態左向き
	DrawFormatString(70, 170, GetColor(255, 255, 255), "i=%d,m=%d", i, m);
	DrawGraph(x + shokix, y + shokiy, st2stdl[i], TRUE);
	

	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);

}
void st2wk2rv() {
	//右歩き
	ClearDrawScreen();
	DrawGraph(x + shokix, y + shokiy, st2wk2[i], TRUE);
	x = x + 2;
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	muki = 0;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);
	if(m==1)PlaySound("foot_SE.mp3", DX_PLAYTYPE_NORMAL);
}
void st2wk2lv() {
	//左歩き
	ClearDrawScreen();
	DrawGraph(x + shokix, y + shokiy, st2wk2l[i], TRUE);
	x = x = x - 2;
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	muki = -1;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);

}
void zahyou()
{
	//x座標数字表示
	for (int i = 0; i <= 600; i++)
	{
		if (i % 50 == 0)
		{
			DrawLine(i, 0, i, 10, GetColor(255, 255, 255));
			DrawFormatString(i, 10, GetColor(255, 255, 255), "%d", i);
		}
	}
	//y座標数字表示
	for (int i = 0; i <= 600; i++)
	{
		if (i > 0)
			if (i % 50 == 0)
			{
				DrawLine(0, i, 10, i, GetColor(255, 255, 255));
				DrawFormatString(10, i, GetColor(255, 255, 255), "%d", i);
			}
	}
	//縦線座標表示
	for (int Q = 0; Q <= 700; Q++)
	{
		if (Q % 50 == 0)
		{
			for (int i = 0; i <= 450; i++)
			{
				if (i % 50 == 0)DrawLine(Q, i - 5, Q, i + 5, GetColor(255, 255, 255));
			}
		}
	}
	//横線座標表示
	for (int Q = 0; Q <= 700; Q++)
	{
		if (Q % 50 == 0)
		{
			for (int i = 0; i <= 450; i++)
			{
				if (i % 50 == 0)DrawLine(Q - 5, i, Q + 5, i, GetColor(255, 255, 255));
			}
		}
	}
}
void jump()
{

	Q++;
	if (Q >= 33)Q=33;
		
	if (Q == 1)y = y - 10;
	if (Q == 2)y = y - 9;
	if (Q == 3)y = y - 9;
	if (Q == 4)y = y - 7;
	if (Q == 5)y = y - 7;
	if (Q == 6)y = y - 7;
	if (Q == 7)y = y - 6;
	if (Q == 8)y = y - 6;
	if (Q == 9)y = y - 6;
	if (Q == 10)y = y - 6;
	if (Q == 11)y = y - 5;
	if (Q == 12)y = y - 5;
	if (Q == 13)y = y - 5;
	if (Q == 14)y = y - 5;
	if (Q == 15)y = y - 5;
	if (Q == 16)y = y - 4;
	if (Q == 17)y = y - 4;
	if (Q == 18)y = y - 4;
	if (Q == 19)y = y - 4;
	if (Q == 20)y = y - 3;
	if (Q == 21)y = y - 3;
	if (Q == 22)y = y - 2;
	if (Q == 23)y = y - 2;
	if (Q == 24)y = y - 2;
	if (Q == 25)y = y - 2;
	if (Q == 26)y = y - 2;
	if (Q == 27)y = y - 2;
	if (Q == 28)y = y - 1;
	if (Q == 29)y = y - 1;
	if (Q == 30)y = y - 1;
	if (Q == 31)y = y - 1;
	if (Q == 32)y = y - 1;

		/*
		
		if (Q == 1)y = y - 8;
		if (Q == 2)y = y - 7;
		if (Q == 3)y = y - 7;
		if (Q == 4)y = y - 6;
		if (Q == 5)y = y - 6;
		if (Q == 6)y = y - 6;
		if (Q == 7)y = y - 5;
		if (Q == 8)y = y - 5;
		if (Q == 9)y = y - 5;
		if (Q == 10)y = y - 5;
		if (Q == 11)y = y - 4;
		if (Q == 12)y = y - 4;
		if (Q == 13)y = y - 4;
		if (Q == 14)y = y - 4;
		if (Q == 15)y = y - 4;
		if (Q == 16)y = y - 3;
		if (Q == 17)y = y - 3;
		if (Q == 18)y = y - 3;
		if (Q == 19)y = y - 3;
		if (Q == 20)y = y - 3;
		if (Q == 21)y = y - 3;
		if (Q == 22)y = y - 2;
		if (Q == 23)y = y - 2;
		if (Q == 24)y = y - 2;
		if (Q == 25)y = y - 2;
		if (Q == 26)y = y - 2;
		if (Q == 27)y = y - 2;
		if (Q == 28)y = y - 1;
		if (Q == 29)y = y - 1;
		if (Q == 30)y = y - 1;
		if (Q == 31)y = y - 1;
		if (Q == 32)y = y - 1;
		*/
}
void gravity()
{
	GPOWER = (33 - Q)/3;
	y = y + GPOWER;
	if (Yzah >= 450)y=y - 450;
	if (CheckHitKey(KEY_INPUT_P))y = y - GPOWER;


}
void stage0()
{
	int AT[4] = { x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3] };
	



	DrawFormatString(10, 130, GetColor(255, 255, 255), "AT[0]=%d", AT[0]);
	DrawFormatString(100, 130, GetColor(255, 255, 255), "AT[1]=%d", AT[1]);
	DrawFormatString(190, 130, GetColor(255, 255, 255), "AT[2]=%d", AT[2]);
	DrawFormatString(280, 130, GetColor(255, 255, 255), "AT[3]=%d", AT[3]);



	//       ここから ここまで
	DrawLine(60, 420, 120,420, GetColor(255, 255, 255));

	if (((60 <= AT[0] && AT[0] <= 120) || (60 <= AT[2] && AT[2] <= 120)) && (420<=AT[3]&&AT[3]<=430))y = y-GPOWER;


}
てあれった No title
C
#include"DxLib.h"


int st2std[10],st2stdl[10],st2wk2[12],st2wk2l[12];
//移動の際使う
int x, y;
//iとmでアニメーションの周期速度調整
int  i = 0, m = 0,P=0,Q=0;
//向き muki>=0右 muki<0左
int muki;
//初期位置
int shokix = 50, shokiy = 320;
//当判定    左上xy,右下xy
int at[4] = {17,18,42,45};
int AT[4];
//重力
int GPOWER;
//自機画像左上のポイント
int Yzah, Xzah;
//接地している場合0 していない場合1 ※考え中
int setti=0;



int st[];

void st2stdrv();
void st2stdlv();
void st2wk2rv();
void st2wk2lv();
void zahyou();
void jump();
void gravity();
void stage0();
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
	ChangeWindowMode(TRUE), DxLib_Init(), SetDrawScreen(DX_SCREEN_BACK);
	

	//右向き
	muki = 0;
	//↓画像10分割,横5分割,縦2分割,一つの横サイズ63,一つの縦サイズ48,代入する変数
	LoadDivGraph("画像/style2-stand.png",10,5,2,63,48,st2std);
	LoadDivGraph("画像/style2-standl.png", 10, 5, 2, 63, 48, st2stdl);
	LoadDivGraph("画像/st2-walk2.png", 12, 6, 2, 63, 48, st2wk2);
	LoadDivGraph("画像/st2-walk2l.png", 12, 6, 2, 63, 48, st2wk2l);
	while (ScreenFlip() == 0 && CheckHitKey(KEY_INPUT_ESCAPE) == 0 && ProcessMessage() == 0 && ClearDrawScreen() == 0) {
		
		Xzah = x + shokix;
		Yzah = y + shokiy;

		if (CheckHitKey(KEY_INPUT_0))zahyou();
		

		if(muki>=0)st2stdrv();
		if (muki < 0)st2stdlv();
		// ボックスの左上[移動先(x)+初期位置(50)+当たり判定X座標左上(17)]                                   FALSE= 塗りつぶしなし
	
		if (CheckHitKey(KEY_INPUT_RIGHT))st2wk2rv();
		if (CheckHitKey(KEY_INPUT_LEFT))st2wk2lv();
		//if (CheckHitKey(KEY_INPUT_UP))y=y--;
		//if (CheckHitKey(KEY_INPUT_DOWN))y=y++;
		//ジャンプ上昇
		if (CheckHitKey(KEY_INPUT_SPACE))jump();
		//ジャンプからボタンを離すとゆるやかに数字が下降
		if (CheckHitKey(KEY_INPUT_SPACE) == 0)Q--, gravity();
		//Qがマイナスにならないよう処理
		if (Q < 0)Q = 0;
		//座標表示
		if (CheckHitKey(KEY_INPUT_Q))zahyou();

		
		stage0();
		

		DrawFormatString(10, 25, GetColor(255, 255, 255), "Q=%d", Q);
		DrawFormatString(10, 65, GetColor(255, 255, 255), "Y座標=%d", Yzah);
		DrawFormatString(10, 80, GetColor(255, 255, 255), "X座標=%d", Xzah);
		DrawFormatString(10, 115, GetColor(255, 255, 255), "GPOWER=%d", GPOWER);

		DrawFormatString(10, 150, GetColor(255, 255, 255), "at[0]=%d", at[0]);
		DrawFormatString(10, 165, GetColor(255, 255, 255), "y=%d", y);
		DrawFormatString(10, 200, GetColor(255, 255, 255), "x=%d", x);
		DrawFormatString(10, 215, GetColor(255, 255, 255), "shokiy=%d", shokiy);
		DrawFormatString(10, 230, GetColor(255, 255, 255), "shokix=%d", shokix);

		

	}
	DxLib_End();
	return 0;
}
void st2stdrv() {
	//立ち状態右向き
	DrawFormatString(100, 170, GetColor(255, 255, 255), "i=%d,m=%d", i, m);
	DrawGraph(x + shokix, y + shokiy, st2std[i], TRUE);
	
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	//自機の白い四角
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);
	//自機の足元ピンク
	DrawLine(x + shokix + at[0], y + shokiy + at[3], x + shokix + at[2] , y + shokiy + at[3], GetColor(255, 0, 255));
	
}
void st2stdlv() {
	//立状態左向き
	DrawFormatString(70, 170, GetColor(255, 255, 255), "i=%d,m=%d", i, m);
	DrawGraph(x + shokix, y + shokiy, st2stdl[i], TRUE);
	

	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);

}
void st2wk2rv() {
	//右歩き
	ClearDrawScreen();
	DrawGraph(x + shokix, y + shokiy, st2wk2[i], TRUE);
	x = x + 2;
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	muki = 0;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);
	if(m==1)PlaySound("foot_SE.mp3", DX_PLAYTYPE_NORMAL);
}
void st2wk2lv() {
	//左歩き
	ClearDrawScreen();
	DrawGraph(x + shokix, y + shokiy, st2wk2l[i], TRUE);
	x = x = x - 2;
	m++;
	if (m % 5 == 0)i++;

	if (i >= 10)i = 0;
	if (m >= 50)m = 0;
	muki = -1;
	DrawBox(x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3], GetColor(255, 255, 255), FALSE);

}
void zahyou()
{
	//x座標数字表示
	for (int i = 0; i <= 600; i++)
	{
		if (i % 50 == 0)
		{
			DrawLine(i, 0, i, 10, GetColor(255, 255, 255));
			DrawFormatString(i, 10, GetColor(255, 255, 255), "%d", i);
		}
	}
	//y座標数字表示
	for (int i = 0; i <= 600; i++)
	{
		if (i > 0)
			if (i % 50 == 0)
			{
				DrawLine(0, i, 10, i, GetColor(255, 255, 255));
				DrawFormatString(10, i, GetColor(255, 255, 255), "%d", i);
			}
	}
	//縦線座標表示
	for (int Q = 0; Q <= 700; Q++)
	{
		if (Q % 50 == 0)
		{
			for (int i = 0; i <= 450; i++)
			{
				if (i % 50 == 0)DrawLine(Q, i - 5, Q, i + 5, GetColor(255, 255, 255));
			}
		}
	}
	//横線座標表示
	for (int Q = 0; Q <= 700; Q++)
	{
		if (Q % 50 == 0)
		{
			for (int i = 0; i <= 450; i++)
			{
				if (i % 50 == 0)DrawLine(Q - 5, i, Q + 5, i, GetColor(255, 255, 255));
			}
		}
	}
}
void jump()
{

	Q++;
	if (Q >= 33)Q=33;
		
	if (Q == 1)y = y - 10;
	if (Q == 2)y = y - 9;
	if (Q == 3)y = y - 9;
	if (Q == 4)y = y - 7;
	if (Q == 5)y = y - 7;
	if (Q == 6)y = y - 7;
	if (Q == 7)y = y - 6;
	if (Q == 8)y = y - 6;
	if (Q == 9)y = y - 6;
	if (Q == 10)y = y - 6;
	if (Q == 11)y = y - 5;
	if (Q == 12)y = y - 5;
	if (Q == 13)y = y - 5;
	if (Q == 14)y = y - 5;
	if (Q == 15)y = y - 5;
	if (Q == 16)y = y - 4;
	if (Q == 17)y = y - 4;
	if (Q == 18)y = y - 4;
	if (Q == 19)y = y - 4;
	if (Q == 20)y = y - 3;
	if (Q == 21)y = y - 3;
	if (Q == 22)y = y - 2;
	if (Q == 23)y = y - 2;
	if (Q == 24)y = y - 2;
	if (Q == 25)y = y - 2;
	if (Q == 26)y = y - 2;
	if (Q == 27)y = y - 2;
	if (Q == 28)y = y - 1;
	if (Q == 29)y = y - 1;
	if (Q == 30)y = y - 1;
	if (Q == 31)y = y - 1;
	if (Q == 32)y = y - 1;

		/*
		
		if (Q == 1)y = y - 8;
		if (Q == 2)y = y - 7;
		if (Q == 3)y = y - 7;
		if (Q == 4)y = y - 6;
		if (Q == 5)y = y - 6;
		if (Q == 6)y = y - 6;
		if (Q == 7)y = y - 5;
		if (Q == 8)y = y - 5;
		if (Q == 9)y = y - 5;
		if (Q == 10)y = y - 5;
		if (Q == 11)y = y - 4;
		if (Q == 12)y = y - 4;
		if (Q == 13)y = y - 4;
		if (Q == 14)y = y - 4;
		if (Q == 15)y = y - 4;
		if (Q == 16)y = y - 3;
		if (Q == 17)y = y - 3;
		if (Q == 18)y = y - 3;
		if (Q == 19)y = y - 3;
		if (Q == 20)y = y - 3;
		if (Q == 21)y = y - 3;
		if (Q == 22)y = y - 2;
		if (Q == 23)y = y - 2;
		if (Q == 24)y = y - 2;
		if (Q == 25)y = y - 2;
		if (Q == 26)y = y - 2;
		if (Q == 27)y = y - 2;
		if (Q == 28)y = y - 1;
		if (Q == 29)y = y - 1;
		if (Q == 30)y = y - 1;
		if (Q == 31)y = y - 1;
		if (Q == 32)y = y - 1;
		*/
}
void gravity()
{
	GPOWER = (33 - Q)/3;
	y = y + GPOWER;
	if (Yzah >= 450)y=y - 450;
	if (CheckHitKey(KEY_INPUT_P))y = y - GPOWER;


}
void stage0()
{
	int AT[4] = { x + shokix + at[0], y + shokiy + at[1], x + shokix + at[2], y + shokiy + at[3] };
	



	DrawFormatString(10, 130, GetColor(255, 255, 255), "AT[0]=%d", AT[0]);
	DrawFormatString(100, 130, GetColor(255, 255, 255), "AT[1]=%d", AT[1]);
	DrawFormatString(190, 130, GetColor(255, 255, 255), "AT[2]=%d", AT[2]);
	DrawFormatString(280, 130, GetColor(255, 255, 255), "AT[3]=%d", AT[3]);



	//       ここから ここまで
	DrawLine(60, 420, 120,420, GetColor(255, 255, 255));

	if (((60 <= AT[0] && AT[0] <= 120) || (60 <= AT[2] && AT[2] <= 120)) && (420<=AT[3]&&AT[3]<=430))y = y-GPOWER;


}

anonymous No title
HTML
<!DOCTYPE html>
<html>

<body>
    <p>Today: <span id="today"></span>
    </p>
    <table border="1" id="calendar">
        <tr>
            <th id="sun">Sun</th>
            <th id="mon">Mon</th>
            <th id="tue">Tue</th>
            <th id="wed">Wed</th>
            <th id="thu">Thu</th>
            <th id="fri">Fri</th>
            <th id="sat">Sat</th>
        </tr>
    </table>
    <script>
        const today = new Date();
        const d = document;
        d.getElementById('today').innerHTML = today.toString();

        const days_of_week = ['sun', 'mon',
            'tue', 'wed', 'thu', 'fri', 'sat'];
        const today_date = days_of_week[today.getDay()];
        const elem = d.getElementById(today_date);
        elem.style.setProperty('background-color', 'lightblue');

        let calendar = d.getElementById('calendar');
        let y = today.getFullYear();
        let m = today.getMonth();

        const month = today.getMonth();
        const lastday_of_month = new Date(y, m + 1, 0).getDate();
        let tr = calendar.appendChild(d.createElement('tr'));

        for (i = 1; i <= lastday_of_month; i++) {
            const date = new Date(y, m, i);
            const day = date.getDay();

            if (i == 1) {
                for (j = 0; j < day; j++) {
                    tr.appendChild(d.createElement('td'));
                }
            }

            if (day == 0) {
                tr = calendar.appendChild(d.createElement('tr'));
            }

            const td = tr.appendChild(d.createElement('td'));
            td.innerHTML = date.getDate();
            if (date.getDate() == today.getDate()) {
                td.style.setProperty('background-color', 'lightblue');
            }

            if (i == lastday_of_month) {
                for (j = day + 1; j <= 6; j++) {
                    tr.appendChild(d.createElement('td'));
                }
            }

        }

        // style
        const td = d.getElementsByTagName('td');
        for (i = 0; i < td.length; i++) {
            td[i].style.setProperty('text-align', 'center');
        }

    </script>
</body>

</html>
anonymous No title
HTML
<!DOCTYPE html>
<html>

<body>
    <div id="sun">Sunday</div>
    <div id="mon">Monday</div>
    <div id="tue">Tuesday</div>
    <div id="wed">Wednesday</div>
    <div id="thu">Thursday</div>
    <div id="fri">Friday</div>
    <div id="sat">Saturday</div>
    <script>
        const date = new Date();
        const today_date = ['sun', 'mon',
            'tue', 'wed', 'thu', 'fri', 'sat'][date.getDay()];
        console.log(today_date);
        const elem = document.getElementById(today_date);
        elem.style.setProperty('background-color', 'lightblue');
    </script>
</body>

</html>
anonymous Node.jsでGoogle Apps Script APIを使う
JavaScript
const fs = require('fs');

const { google } = require('googleapis');
const OAuth2 = google.auth.OAuth2;

// OAuthクライアントを初期化
const creds = JSON.parse(fs.readFileSync('creds.json', 'utf-8')).installed;
const oauth2Client = new OAuth2(
    creds.client_id,
    creds.client_secret,
    'urn:ietf:wg:oauth:2.0:oob'
);

// 認証コードを取得するためのURLを取得
const getAuthorizeUrl = () => {
    const authorizeUrl = oauth2Client.generateAuthUrl({
        access_type: 'offline',
        scope: [
            'https://www.googleapis.com/auth/script.scriptapp',
            'https://www.googleapis.com/auth/drive'
        ],
    });
    return authorizeUrl;
}

// トークンを取得してJSONファイルに保存
const getToken = () => {
    const code = 'getAuthorizeUrlで得たコード';
    oauth2Client.getToken(code, (err, token) => {
        fs.writeFileSync('token.json', JSON.stringify(token));
    });
}

// GAS APIを実行
const callAppsScript = (auth) => {
    const scriptId = 'デプロイID';
    const script = google.script('v1');
    script.scripts.run({
        auth: auth,
        resource: {
            function: 'doSomething',
        },
        scriptId: scriptId,
    }, (err, resp) => {
        // GASの関数からの戻り値
        console.log(resp.data.response.result);
    });
}

// エントリー
const main = () => {
    // JSONからトークンを取得してOAuthClientにセットする
    const token = JSON.parse(fs.readFileSync('token.json', 'utf-8'));
    oauth2Client.setCredentials(token);
    // GASの関数を実行
    callAppsScript(oauth2Client);
}


main();
anonymous No title
Rust
struct Student {
    first_name: String,
    last_name: String,
    #[allow(unused)]
    full_name: String,
}

impl Student {
    fn new(first_name: &str, middle_initial: &str, last_name: &str) -> Self {
        Self {
            first_name: first_name.into(),
            last_name: last_name.into(),
            full_name: format!("{first_name} {middle_initial} {last_name}"),
        }
    }
}

impl Person for Student {
    fn first_name(&self) -> String {
        self.first_name.clone()
    }

    fn last_name(&self) -> String {
        self.last_name.clone()
    }
}

trait Person {
    fn first_name(&self) -> String;
    fn last_name(&self) -> String;
}

//fn greeter(person: impl Person) -> String { // またはこう
fn greeter<P: Person>(person: P) -> String {
    format!("Hello, {} {}", person.first_name(), person.last_name())
}

fn main() {
    let user = Student::new("Jane", "M.", "User");
    println!("{}", greeter(user));
}