Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Created June 11, 2023 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zr-tex8r/8777a3cf86de88ec0c3d25f2b6269b11 to your computer and use it in GitHub Desktop.
Save zr-tex8r/8777a3cf86de88ec0c3d25f2b6269b11 to your computer and use it in GitHub Desktop.
Typst:ドドスコ(ラブ注入♡)する文書
#import "zrjasimple.typ"
#show: zrjasimple.doc.with(
title: "Typst でドドスコしてみた",
author: "某 ZR"
)
// ddsk(seed)は, 乱数種を seed としたときの
// "ドドスコ問題"の出力の文字列.
#let ddsk(seed) = {
let (m, a) = (0x7FFFFFFF, 16807)
let next(v) = calc.rem(v * a, m)
let r = next(next(seed))
let s = 0
while s != 0x888 {
let b = calc.odd(int(r / 0x4000))
s = calc.rem(s * 2 + int(b), 0x1000)
if b {"ドド"} else {"スコ"}
r = next(r)
}
"ラブ注入♡"
}
#ddsk(80000)
#let doc(title: "", author: "", body) = {
set document(author: author, title: title)
set page(paper: "a5", margin: 21.2mm,
numbering: "1", number-align: center)
set text(font: "Harano Aji Mincho", size: 10pt, lang: "ja")
align(center)[
#block(text(weight: 700, 2em, title))
#v(1em, weak: true)
#text(1.4em, author)
]
set par(justify: true)
body
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment