Last active
August 22, 2016 02:14
-
-
Save youxkei/bd75020b35315e5e62c71546f98350c1 to your computer and use it in GitHub Desktop.
This file contains 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
import std.algorithm : map, each; | |
import std.conv : to; | |
import std.range : retro, zip, iota, cycle; | |
import std.array : array, join; | |
import std.functional : adjoin; | |
import std.stdio : writeln; | |
void main() | |
{ | |
static immutable ERUTASO = ["えー", "びー", "しー", "でぃー", "いー", "えふ", "じー", "えいち", "あい", "じぇー", "けー", "える", "えむ", "えぬ", "おー", "ぴー", "きゅー", "あーる", "えす", "てぃー", "ゆー", "ぶい", "だぶりゅー", "えっくす", "わい", "ぜっと"]; | |
static immutable N_LIST = ["", "一", "二", "三", "四", "五", "六", "七", "八", "九"]; | |
static immutable N2_LIST = ["", "十", "百", "千"]; | |
1000 | |
.iota | |
.map!(n => n + 1) | |
.map!(n => n | |
.to!string | |
.adjoin!( | |
map!(c => c - '0'), | |
str => str.length.iota.retro | |
) | |
.field | |
.zip | |
.map!(elem => | |
elem[0] == 0 ? "" : | |
elem[0] == 1 ? | |
elem[1] == 0 ? "一" : | |
N2_LIST[elem[1]] : | |
N_LIST[elem[0]] ~ N2_LIST[elem[1]] | |
) | |
.join | |
) | |
.zip(ERUTASO.cycle) | |
.map!(elem => elem[0] ~ "反田" ~ elem[1]) | |
.each!(writeln); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment