Skip to content

Instantly share code, notes, and snippets.

@zakki
zakki / _hsp37_ios_file.patch
Last active November 1, 2025 07:03
Fix HSP 3.7 file I/O
diff --git i/hspproj/hsp3/filepack.cpp w/hspproj/hsp3/filepack.cpp
index c03bc83..1f4beba 100644
--- i/hspproj/hsp3/filepack.cpp
+++ w/hspproj/hsp3/filepack.cpp
@@ -244,22 +244,24 @@ int FilePack::pack_fgetc(FILE* ptr)
int FilePack::pack_flength(char* name)
{
+ HFPOBJ* obj;
+ obj = SearchFileObject(name);
; hspcmp -i multibyte_test1.hsp
AB = 10
A B = 20
A B = 30
mes AB
mes A B
mes A B
/*
hsp3cl multibyte_test1.ax
@zakki
zakki / go2sgf.py
Last active April 24, 2025 12:26
Go OCR development with ChatGPT 4o
# Go image to sgf
import os
import sys
import math
import re
import string
import cv2
import numpy as np
#include <iostream>
class A {
public:
virtual int foo() = 0;
};
class B : public A {
public:
virtual int foo() override {
@zakki
zakki / fiz.S
Created September 20, 2023 04:22
// as fiz.S -o fiz.o
// ld -o fiz.out fiz.o
.globl _start
_start:
movl $4,%eax
movl $1,%ebx
movl $msg,%ecx
movl $408,%edx
int $0x80

GTP大会対局拡張案 ver 0.1

意図

囲碁AI大会やCGOSで、双方の読み筋や評価を見たい。

既存実装

shogi-server拡張

@zakki
zakki / rand.c
Created November 13, 2022 03:55
#include <emscripten.h>
#include <stdio.h>
#include <stdlib.h>
static uint64_t x;
EMSCRIPTEN_KEEPALIVE uint64_t xorShiftSeed(int initialState) {
x = initialState;// & 0xFFFFFFFFFFFFFFFFL;
return x;
}
#!/bin/bash
(
cd openhsp
git svn fetch
)
(
cd hsp-minimized
git fetch ../openhsp svn/trunk
BigInt("0b10001") * BigInt("0b" +(
"__##__#_#_#___#__" +
"__#_#_#_#_#####__" +
"__#__#__#_#______" +
"_________________" +
"________#________" +
"_______#_#_______" +
"______#___#______" +
"_________________" +
"#################" +
#include <set>
#include <iostream>
template<typename T> size_t collatz(T x) {
std::set<T> xs;
size_t n = 0;
for (;; n++) {
if (x == 1)
break;
if (xs.find(x) != xs.end()) {