Skip to content

Instantly share code, notes, and snippets.

View hsjoihs's full-sized avatar

hsjoihs hsjoihs

View GitHub Profile
@hsjoihs
hsjoihs / README-Template.md
Created February 13, 2017 23:48 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@hsjoihs
hsjoihs / Makefile
Created February 14, 2017 00:28
tmp
install : ccsc ccsrc
ccsc : ghc
ghc --make ccsc -o ccsc && chmod 755 ccsc
ccsrc : ghc
ghc --make ccsrc -o ccsrc && chmod 755 ccsrc
ghc :
sudo apt-get install haskell-platform
(Moved to https://github.com/sozysozbot/akrantiain2/blob/master/samples/sample_swedish.txt)
(Moved to https://github.com/sozysozbot/akrantiain2/blob/master/samples/sample_lineparine.txt)
後述するように、手が揃いやすいので字牌を削ってツモ数を削る
https://twitter.com/hsjoihs/status/910420220816236544
(後述する槓子以外の)面子の条件は「3つの牌で作れる数が素数であること」、雀頭の条件は「2つの牌で作れる数が素数であること」
https://twitter.com/hsjoihs/status/910408195750764544
4つの面子が四つ子素数をなすとき役満
https://twitter.com/asangi_a4ac/status/910415367465345024
https://twitter.com/nullset_mn/status/910418411766681600
calc :: [a] -> Int -> (a -> a -> a) -> [a]
calc xs n o = ys ++ [o a b] ++ zs where (ys,a:b:zs) = splitAt n xs
connect :: [String] -> Int -> String -> [String]
connect xs n o = calc xs n (f o)
where f o a b = "(" ++ a ++ " " ++ o ++ " " ++ b ++ ")"
toAll :: (c -> a -> b -> c) -> c -> [a] -> [b] -> c
toAll _ xs [] [] = xs
toAll f xs (n:ns) (o:os) = toAll f (f xs n o) ns os
@hsjoihs
hsjoihs / buggy.saty
Last active February 11, 2018 00:20
SATySFiの行送りのバグっぽいもの。ソースコードは https://github.com/gfngfn/SATySFi/tree/master/demo を改変。
@require: stdjabook
@require: code
@require: itemize
@require: tabular
@require: math
@import: local
document (|
title = {Buggy?};
author = {hsjoihs};
@require: stdjabook
@require: hdecoset
@require: vdecoset
@require: code
@require: list
let-block ctx +centering it =
line-break true true ctx (inline-fil ++ read-inline ctx it ++ inline-fil)
@hsjoihs
hsjoihs / dijkstra_like.js
Created March 26, 2018 12:08
「友達がなんかオリジナルのDijkstra法を改良できたっぽいのでコード見てもらえますか?」というDMが来た、嘘解法っぽさあるけど反例分からん
/* DMで相談がきたソースコード */
/*
id:{image:'path',cost:INF,done:[],route:"",positionX:"latitude",positionY:"elevation",positionZ:"longitude",links:["link_1","link_0"]}
costに頂点に到達するまでのコスト、doneで最短距離を調べ終わったやつ、
routeに最短距離でどの頂点から来たか、positionXに緯度、
positionYに高度、positionZに経度、
linksに配列でその頂点につながってる頂点
@hsjoihs
hsjoihs / !POST to wandbox
Last active June 17, 2019 01:49
POST to wandbox
POST to wandbox