Created
June 9, 2022 23:58
-
-
Save abikoushi/78b8ca35e637021c0d936860270c0922 to your computer and use it in GitHub Desktop.
Japanese traditional cryptogram
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tanuki <- function(x,n){ | |
letter <- "た" | |
len <- nchar(x) | |
p <- sort(sample(2:len,n)) | |
sv <- character(n+1) | |
sv[1] <-substr(x,1,p[1]) | |
for(i in 1:(n-1)){ | |
sv[i+1] <- substr(x,p[i]+1L,p[i+1]) | |
} | |
sv[n+1L] <- substr(x,p[n]+1L,len) | |
paste(sv, collapse = letter) | |
} | |
x <- "お疲れ様です。お忙しい中ご対応誠にありがとうございます。資料を拝見し、CVの増加など良い結果が得られていると感じます。ミーティングについては、13日(来週月曜日)15時以降はいかがでしょうか。" | |
tanuki(x,40) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment