Documentation ¶
Overview ¶
ダイスの内部表現のパッケージ。
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDice ¶
FormatDice はダイス列を文字列として整形して返す。 結果の文字列は "値/面数, 値/面数, ..." という形式。
Example ¶
ダイス列の整形例。
ds := []Die{{2, 4}, {3, 6}, {5, 10}, {10, 20}} fmt.Println(FormatDice(ds))
Output: 2/4, 3/6, 5/10, 10/20
func FormatDiceWithoutSpaces ¶
FormatDiceWithoutSpaces はダイス列を文字列として整形して返す。 結果の文字列は "値/面数,値/面数,..." という形式。 空白を出力しないので、テストケースなどで使うとよい。
Example ¶
ダイス列の整形例(空白なし)。
ds := []Die{{2, 4}, {3, 6}, {5, 10}, {10, 20}} fmt.Println(FormatDiceWithoutSpaces(ds))
Output: 2/4,3/6,5/10,10/20
Types ¶
Click to show internal directories.
Click to hide internal directories.