Skip to content

Instantly share code, notes, and snippets.

@windfall-shogi
windfall-shogi / usi_wrapper.py
Created November 23, 2020 08:18
google colabでusiエンジンを動かすための方向性を示すためのコード
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
google colabでusiプロトコルの対局エンジンを動かすためのプロトタイプ
TODO:
いろいろとデバッグ
時間設定と自分の使用した時間の管理
読み筋などの表示
対局結果の取得
@windfall-shogi
windfall-shogi / fv40_cshogi.py
Created September 23, 2019 05:39
cshogiを用いたfv40
def fv40(board):
p_index, q_index = [], []
for square in range(81):
piece = board.piece(square)
if piece == 0:
continue
piece_type = piece & 0xF
if piece_type != 8:
piece_color = piece >> 4