Skip to content

Instantly share code, notes, and snippets.

diff --git a/cppshogi/Makefile b/cppshogi/Makefile
index 064d40c..f381095 100644
--- a/cppshogi/Makefile
+++ b/cppshogi/Makefile
@@ -4,8 +4,8 @@ PYTHON_PREFIX=/usr
CC = g++
CFLAGS = -std=c++17 -Wextra -Ofast -MMD -MP -fopenmp -DNDEBUG -DHAVE_SSE4 -DHAVE_SSE42 -DHAVE_BMI2 -msse4.2 -mbmi2 -DHAVE_AVX2 -mavx2 -fPIC
LDFLAGS = -lpthread -lz -flto
-INCLUDE = -I$(PYTHON_PREFIX)/include/python3.7m -I$(PYTHON_PREFIX)/include
-LIB = -L$(PYTHON_PREFIX)/lib -lpython3.7m -lboost_python -lboost_numpy -lpthread -ldl -lutil -lm -Xlinker -export-dynamic
@mizar
mizar / qrcode.ps1
Last active November 16, 2023 16:36
QR Code display with Powershell
# QR Code display with Powershell
# License: MIT
# usage example:
# powershell.exe -Exec bypass -File qrcode.ps1 -Payload https://qiita.com/ -EccLevel Q
# powershell.exe -Exec bypass -File qrcode.ps1 -Payload "日本語SJIS" -EccLevel Q -Encoding SJIS
# powershell.exe -Exec bypass -File qrcode.ps1 -Payload "日本語UTF8" -EccLevel Q -Encoding UTF-8
Param(
# String to be embedded in QR Code
[String]$Payload = "https://github.com/",
@mizar
mizar / qrcode_br.ps1
Last active March 21, 2021 21:13
QR Code display with Powershell
# QR Code display with Powershell
# License: MIT
# usage example:
# powershell.exe -Exec bypass -File qrcode.ps1 -Payload https://qiita.com/ -EccLevel Q
# powershell.exe -Exec bypass -File qrcode.ps1 -Payload "日本語SJIS" -EccLevel Q -Encoding SJIS
# powershell.exe -Exec bypass -File qrcode.ps1 -Payload "日本語UTF8" -EccLevel Q -Encoding UTF-8
Param(
# String to be embedded in QR Code
[String]$Payload = "https://github.com/",
FROM nvcr.io/nvidia/cuda:11.4.2-cudnn8-devel-ubuntu20.04 AS builder
SHELL ["/bin/bash", "-c"]
RUN \
export DEBIAN_FRONTEND=noninteractive &&\
sed -i.bak -r 's!(deb|deb-src) http://archive\.ubuntu\.com/\S+!\1 mirror://mirrors.ubuntu.com/mirrors.txt!' /etc/apt/sources.list &&\
apt-get update &&\
apt-get -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" install \
curl gpg &&\
FROM ubuntu:20.04
SHELL ["/bin/bash", "-c"]
# mirror://mirrors.ubuntu.com/mirrors.txt
RUN \
touch /etc/apt/mirrorlist.txt &&\
echo "http://ubuntu-ashisuto.ubuntulinux.jp/ubuntu/" >> /etc/apt/mirrorlist.txt &&\
echo "http://www.ftp.ne.jp/Linux/packages/ubuntu/archive/" >> /etc/apt/mirrorlist.txt &&\
echo "http://ftp.riken.jp/Linux/ubuntu/" >> /etc/apt/mirrorlist.txt &&\
@mizar
mizar / ki2moveformat.md
Last active March 6, 2022 03:15
将棋の棋譜表記方法(伝統形式)

将棋の棋譜表記方法(伝統形式)

全体

graph LR;
flowstart((start)) --> A((基本<br>start)) --> At{手番の記号を出力するか} --> |手番の記号なし| Atn["手番の記号を出力しない"] --> As{直前の相手の駒の到達地点と<br>同じ地点か} --> A1[/"到達地点の筋を出力<br>算用数字"/] --> A2[/"到達地点の段を出力<br>新聞・本・雑誌などでは漢数字<br>日本将棋連盟の棋譜記録では算用数字"/] --> A3[/"駒の種類を出力"/] --> Az((基本<br>end)) --> B{持ち駒を打つ<br>置き駒を動かす};
At --> |先手番を明記| Atb[/"先手番の記号を出力<br>例:「☗」「⛊」「▲」「▼」"/] --> As;
At --> |後手番を明記| Atw[/"後手番の記号を出力<br>例:「☖」「⛉」「△」「▽」"/] --> As;
As --> |同じ| As0[/"「同」を出力<br>新聞・本などでは改頁などの都合で<br>「7六同歩」のような表記をする場合あり"/] --> A3;

👇

$$ \operatorname{I}x(a,b)=\dots, d{2n}=\dots $$

👆

$$ \operatorname{I}_x(a,b)=\dots, d_{2n}=\dots $$
@mizar
mizar / usiengine_flow.md
Last active May 28, 2022 09:18
将棋AI:USIエンジン遷移遷移図(抄)

USIエンジン状態遷移図(抄)

graph LR;
flowstart((起動)) -->|usi| usioption[/option/] --> usiok[/usiok/] --> usimode((USIモード)) -->|isready| isready[初期化処理] --> readyok[/readyok/] --> ready((初期化済み))
--> |usinewgame| ingame((対局中));
usimode -->|setoption| setoption[オプション設定] --> usimode;
ingame -->|go| search((探索)) -->|"(探索完了)"| bestmove[/bestmove/] --> ingame;
ingame -->|position| setposition[局面設定] --> ingame;
search -->|stop| bestmove;
@mizar
mizar / .gitattributes
Last active May 31, 2022 15:06
将棋AI:USIエンジン:ランダムプレイヤー
* text=auto
*.bat text eol=crlf
*.cmd text eol=crlf
*.sh text eol=lf
@mizar
mizar / .gitattributes
Last active August 20, 2022 14:56
将棋AI:USIエンジン:Policyプレイヤー
* text=auto
*.bat text eol=crlf
*.cmd text eol=crlf
*.sh text eol=lf
*.onnx -text
*.zip -text