bcdice 3.0.0.pre.alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.editorconfig +21 -0
- data/.github/.codecov.yaml +10 -0
- data/.github/workflows/coverage.yaml +21 -0
- data/.github/workflows/lint.yaml +13 -0
- data/.github/workflows/test.yml +20 -0
- data/.gitignore +14 -0
- data/.rubocop.yml +96 -0
- data/.rubocop_todo.yml +113 -0
- data/CHANGELOG.md +868 -0
- data/Gemfile +11 -0
- data/LICENSE +29 -0
- data/README.md +38 -0
- data/ROADMAP.md +30 -0
- data/Rakefile +118 -0
- data/bcdice.gemspec +27 -0
- data/bin/repl.rb +21 -0
- data/docs/README.txt +2028 -0
- data/docs/dicebot_sort_key.md +72 -0
- data/docs/how_to_make_dicebot.md +453 -0
- data/lib/bcdice.rb +8 -0
- data/lib/bcdice/arithmetic_evaluator.rb +167 -0
- data/lib/bcdice/base.rb +423 -0
- data/lib/bcdice/command_parser.rb +242 -0
- data/lib/bcdice/common_command.rb +23 -0
- data/lib/bcdice/common_command/add_dice.rb +54 -0
- data/lib/bcdice/common_command/add_dice/node.rb +488 -0
- data/lib/bcdice/common_command/add_dice/parser.rb +282 -0
- data/lib/bcdice/common_command/add_dice/randomizer.rb +48 -0
- data/lib/bcdice/common_command/barabara_dice.rb +57 -0
- data/lib/bcdice/common_command/calc.rb +39 -0
- data/lib/bcdice/common_command/choice.rb +35 -0
- data/lib/bcdice/common_command/d66_dice.rb +63 -0
- data/lib/bcdice/common_command/reroll_dice.rb +190 -0
- data/lib/bcdice/common_command/upper_dice.rb +165 -0
- data/lib/bcdice/common_command/version.rb +26 -0
- data/lib/bcdice/dice_table.rb +8 -0
- data/lib/bcdice/dice_table/chain_table.rb +33 -0
- data/lib/bcdice/dice_table/d66_grid_table.rb +26 -0
- data/lib/bcdice/dice_table/d66_range_table.rb +26 -0
- data/lib/bcdice/dice_table/d66_table.rb +34 -0
- data/lib/bcdice/dice_table/range_table.rb +267 -0
- data/lib/bcdice/dice_table/roll_result.rb +43 -0
- data/lib/bcdice/dice_table/sai_fic_skill_table.rb +32 -0
- data/lib/bcdice/dice_table/table.rb +35 -0
- data/lib/bcdice/enum.rb +15 -0
- data/lib/bcdice/format.rb +36 -0
- data/lib/bcdice/game_system.rb +187 -0
- data/lib/bcdice/game_system/AFF2e.rb +141 -0
- data/lib/bcdice/game_system/AceKillerGene.rb +55 -0
- data/lib/bcdice/game_system/Airgetlamh.rb +117 -0
- data/lib/bcdice/game_system/Alsetto.rb +124 -0
- data/lib/bcdice/game_system/Alshard.rb +27 -0
- data/lib/bcdice/game_system/AlterRaise.rb +282 -0
- data/lib/bcdice/game_system/Amadeus.rb +622 -0
- data/lib/bcdice/game_system/Amadeus_Korean.rb +501 -0
- data/lib/bcdice/game_system/AnimaAnimus.rb +96 -0
- data/lib/bcdice/game_system/Arianrhod.rb +50 -0
- data/lib/bcdice/game_system/ArsMagica.rb +149 -0
- data/lib/bcdice/game_system/Avandner.rb +101 -0
- data/lib/bcdice/game_system/BBN.rb +143 -0
- data/lib/bcdice/game_system/BadLife.rb +435 -0
- data/lib/bcdice/game_system/BarnaKronika.rb +188 -0
- data/lib/bcdice/game_system/BattleTech.rb +530 -0
- data/lib/bcdice/game_system/BeastBindTrinity.rb +348 -0
- data/lib/bcdice/game_system/BeginningIdol.rb +2527 -0
- data/lib/bcdice/game_system/BeginningIdol_Korean.rb +2378 -0
- data/lib/bcdice/game_system/BladeOfArcana.rb +252 -0
- data/lib/bcdice/game_system/BlindMythos.rb +460 -0
- data/lib/bcdice/game_system/BloodCrusade.rb +423 -0
- data/lib/bcdice/game_system/BloodMoon.rb +213 -0
- data/lib/bcdice/game_system/CardRanker.rb +249 -0
- data/lib/bcdice/game_system/ChaosFlare.rb +181 -0
- data/lib/bcdice/game_system/Chill.rb +163 -0
- data/lib/bcdice/game_system/Chill3.rb +52 -0
- data/lib/bcdice/game_system/CodeLayerd.rb +132 -0
- data/lib/bcdice/game_system/ColossalHunter.rb +569 -0
- data/lib/bcdice/game_system/CrashWorld.rb +81 -0
- data/lib/bcdice/game_system/Cthulhu.rb +252 -0
- data/lib/bcdice/game_system/Cthulhu7th.rb +767 -0
- data/lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb +386 -0
- data/lib/bcdice/game_system/Cthulhu7th_Korean.rb +383 -0
- data/lib/bcdice/game_system/CthulhuTech.rb +263 -0
- data/lib/bcdice/game_system/Cthulhu_ChineseTraditional.rb +243 -0
- data/lib/bcdice/game_system/Cthulhu_Korean.rb +240 -0
- data/lib/bcdice/game_system/DarkBlaze.rb +207 -0
- data/lib/bcdice/game_system/DarkDaysDrive.rb +425 -0
- data/lib/bcdice/game_system/DarkSouls.rb +91 -0
- data/lib/bcdice/game_system/DeadlineHeroes.rb +583 -0
- data/lib/bcdice/game_system/DemonParasite.rb +524 -0
- data/lib/bcdice/game_system/DetatokoSaga.rb +310 -0
- data/lib/bcdice/game_system/DetatokoSaga_Korean.rb +310 -0
- data/lib/bcdice/game_system/DiceBot.rb +17 -0
- data/lib/bcdice/game_system/DiceOfTheDead.rb +111 -0
- data/lib/bcdice/game_system/DoubleCross.rb +373 -0
- data/lib/bcdice/game_system/DoubleCross_Korean.rb +371 -0
- data/lib/bcdice/game_system/Dracurouge.rb +1856 -0
- data/lib/bcdice/game_system/Dracurouge_Korean.rb +310 -0
- data/lib/bcdice/game_system/DungeonsAndDragons.rb +19 -0
- data/lib/bcdice/game_system/EarthDawn.rb +225 -0
- data/lib/bcdice/game_system/EarthDawn3.rb +275 -0
- data/lib/bcdice/game_system/EarthDawn4.rb +272 -0
- data/lib/bcdice/game_system/EclipsePhase.rb +51 -0
- data/lib/bcdice/game_system/Elric.rb +36 -0
- data/lib/bcdice/game_system/Elysion.rb +1213 -0
- data/lib/bcdice/game_system/EmbryoMachine.rb +227 -0
- data/lib/bcdice/game_system/EndBreaker.rb +132 -0
- data/lib/bcdice/game_system/EtrianOdysseySRS.rb +27 -0
- data/lib/bcdice/game_system/Fiasco.rb +123 -0
- data/lib/bcdice/game_system/Fiasco_Korean.rb +122 -0
- data/lib/bcdice/game_system/FilledWith.rb +1543 -0
- data/lib/bcdice/game_system/FullMetalPanic.rb +27 -0
- data/lib/bcdice/game_system/FutariSousa.rb +994 -0
- data/lib/bcdice/game_system/FutariSousa_Korean.rb +994 -0
- data/lib/bcdice/game_system/Garako.rb +559 -0
- data/lib/bcdice/game_system/GardenOrder.rb +451 -0
- data/lib/bcdice/game_system/GehennaAn.rb +136 -0
- data/lib/bcdice/game_system/GeishaGirlwithKatana.rb +120 -0
- data/lib/bcdice/game_system/GoblinSlayer.rb +168 -0
- data/lib/bcdice/game_system/GoldenSkyStories.rb +77 -0
- data/lib/bcdice/game_system/Gorilla.rb +44 -0
- data/lib/bcdice/game_system/GranCrest.rb +518 -0
- data/lib/bcdice/game_system/Gundog.rb +52 -0
- data/lib/bcdice/game_system/GundogRevised.rb +294 -0
- data/lib/bcdice/game_system/GundogZero.rb +261 -0
- data/lib/bcdice/game_system/Gurps.rb +403 -0
- data/lib/bcdice/game_system/GurpsFW.rb +2330 -0
- data/lib/bcdice/game_system/HarnMaster.rb +208 -0
- data/lib/bcdice/game_system/HatsuneMiku.rb +706 -0
- data/lib/bcdice/game_system/Hieizan.rb +48 -0
- data/lib/bcdice/game_system/HouraiGakuen.rb +270 -0
- data/lib/bcdice/game_system/HuntersMoon.rb +503 -0
- data/lib/bcdice/game_system/Illusio.rb +89 -0
- data/lib/bcdice/game_system/InfiniteFantasia.rb +51 -0
- data/lib/bcdice/game_system/Insane.rb +822 -0
- data/lib/bcdice/game_system/Insane_Korean.rb +773 -0
- data/lib/bcdice/game_system/IthaWenUa.rb +38 -0
- data/lib/bcdice/game_system/JamesBond.rb +45 -0
- data/lib/bcdice/game_system/Kamigakari.rb +394 -0
- data/lib/bcdice/game_system/Kamigakari_Korean.rb +428 -0
- data/lib/bcdice/game_system/KanColle.rb +938 -0
- data/lib/bcdice/game_system/KemonoNoMori.rb +258 -0
- data/lib/bcdice/game_system/KillDeathBusiness.rb +1420 -0
- data/lib/bcdice/game_system/KillDeathBusiness_Korean.rb +1510 -0
- data/lib/bcdice/game_system/KurayamiCrying.rb +49 -0
- data/lib/bcdice/game_system/LiveraDoll.rb +375 -0
- data/lib/bcdice/game_system/LogHorizon.rb +3567 -0
- data/lib/bcdice/game_system/LogHorizon_Korean.rb +1407 -0
- data/lib/bcdice/game_system/LostRecord.rb +30 -0
- data/lib/bcdice/game_system/LostRoyal.rb +242 -0
- data/lib/bcdice/game_system/MagicaLogia.rb +1148 -0
- data/lib/bcdice/game_system/MeikyuDays.rb +415 -0
- data/lib/bcdice/game_system/MeikyuKingdom.rb +466 -0
- data/lib/bcdice/game_system/MeikyuKingdomBasic.rb +269 -0
- data/lib/bcdice/game_system/MetalHead.rb +249 -0
- data/lib/bcdice/game_system/MetalHeadExtream.rb +917 -0
- data/lib/bcdice/game_system/MetallicGuardian.rb +31 -0
- data/lib/bcdice/game_system/MonotoneMuseum.rb +354 -0
- data/lib/bcdice/game_system/MonotoneMuseum_Korean.rb +304 -0
- data/lib/bcdice/game_system/Nechronica.rb +211 -0
- data/lib/bcdice/game_system/Nechronica_Korean.rb +160 -0
- data/lib/bcdice/game_system/NeverCloud.rb +74 -0
- data/lib/bcdice/game_system/NightWizard.rb +231 -0
- data/lib/bcdice/game_system/NightWizard3rd.rb +24 -0
- data/lib/bcdice/game_system/NightmareHunterDeep.rb +117 -0
- data/lib/bcdice/game_system/NinjaSlayer.rb +274 -0
- data/lib/bcdice/game_system/NjslyrBattle.rb +54 -0
- data/lib/bcdice/game_system/Nuekagami.rb +293 -0
- data/lib/bcdice/game_system/OneWayHeroics.rb +134 -0
- data/lib/bcdice/game_system/OracleEngine.rb +265 -0
- data/lib/bcdice/game_system/OrgaRain.rb +77 -0
- data/lib/bcdice/game_system/Oukahoushin3rd.rb +162 -0
- data/lib/bcdice/game_system/Paradiso.rb +323 -0
- data/lib/bcdice/game_system/Paranoia.rb +64 -0
- data/lib/bcdice/game_system/ParanoiaRebooted.rb +109 -0
- data/lib/bcdice/game_system/ParasiteBlood.rb +231 -0
- data/lib/bcdice/game_system/Pathfinder.rb +21 -0
- data/lib/bcdice/game_system/Peekaboo.rb +324 -0
- data/lib/bcdice/game_system/Pendragon.rb +39 -0
- data/lib/bcdice/game_system/PhantasmAdventure.rb +73 -0
- data/lib/bcdice/game_system/Postman.rb +185 -0
- data/lib/bcdice/game_system/PulpCthulhu.rb +184 -0
- data/lib/bcdice/game_system/Raisondetre.rb +171 -0
- data/lib/bcdice/game_system/RecordOfLodossWar.rb +58 -0
- data/lib/bcdice/game_system/RecordOfSteam.rb +149 -0
- data/lib/bcdice/game_system/RokumonSekai2.rb +110 -0
- data/lib/bcdice/game_system/RoleMaster.rb +24 -0
- data/lib/bcdice/game_system/RuneQuest.rb +47 -0
- data/lib/bcdice/game_system/RyuTuber.rb +266 -0
- data/lib/bcdice/game_system/Ryutama.rb +199 -0
- data/lib/bcdice/game_system/SRS.rb +348 -0
- data/lib/bcdice/game_system/SamsaraBallad.rb +111 -0
- data/lib/bcdice/game_system/Satasupe.rb +1173 -0
- data/lib/bcdice/game_system/ScreamHighSchool.rb +128 -0
- data/lib/bcdice/game_system/SevenFortressMobius.rb +34 -0
- data/lib/bcdice/game_system/ShadowRun.rb +26 -0
- data/lib/bcdice/game_system/ShadowRun4.rb +49 -0
- data/lib/bcdice/game_system/ShadowRun5.rb +80 -0
- data/lib/bcdice/game_system/SharedFantasia.rb +69 -0
- data/lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb +85 -0
- data/lib/bcdice/game_system/ShinkuuGakuen.rb +506 -0
- data/lib/bcdice/game_system/ShinobiGami.rb +680 -0
- data/lib/bcdice/game_system/ShoujoTenrankai.rb +677 -0
- data/lib/bcdice/game_system/Skynauts.rb +324 -0
- data/lib/bcdice/game_system/SteamPunkers.rb +485 -0
- data/lib/bcdice/game_system/StellarKnights.rb +856 -0
- data/lib/bcdice/game_system/SterileLife.rb +452 -0
- data/lib/bcdice/game_system/StrangerOfSwordCity.rb +103 -0
- data/lib/bcdice/game_system/StratoShout.rb +316 -0
- data/lib/bcdice/game_system/StratoShout_Korean.rb +314 -0
- data/lib/bcdice/game_system/Strave.rb +223 -0
- data/lib/bcdice/game_system/SwordWorld.rb +491 -0
- data/lib/bcdice/game_system/SwordWorld2_0.rb +295 -0
- data/lib/bcdice/game_system/SwordWorld2_5.rb +121 -0
- data/lib/bcdice/game_system/TherapieSein.rb +93 -0
- data/lib/bcdice/game_system/TokumeiTenkousei.rb +96 -0
- data/lib/bcdice/game_system/TokyoGhostResearch.rb +122 -0
- data/lib/bcdice/game_system/TokyoNova.rb +19 -0
- data/lib/bcdice/game_system/Torg.rb +364 -0
- data/lib/bcdice/game_system/Torg1_5.rb +139 -0
- data/lib/bcdice/game_system/TorgEternity.rb +414 -0
- data/lib/bcdice/game_system/TrinitySeven.rb +364 -0
- data/lib/bcdice/game_system/TunnelsAndTrolls.rb +287 -0
- data/lib/bcdice/game_system/TwilightGunsmoke.rb +527 -0
- data/lib/bcdice/game_system/Utakaze.rb +153 -0
- data/lib/bcdice/game_system/VampireTheMasquerade5th.rb +132 -0
- data/lib/bcdice/game_system/Villaciel.rb +555 -0
- data/lib/bcdice/game_system/WARPS.rb +33 -0
- data/lib/bcdice/game_system/WaresBlade.rb +34 -0
- data/lib/bcdice/game_system/Warhammer.rb +336 -0
- data/lib/bcdice/game_system/WitchQuest.rb +275 -0
- data/lib/bcdice/game_system/WorldOfDarkness.rb +135 -0
- data/lib/bcdice/game_system/YankeeYogSothoth.rb +440 -0
- data/lib/bcdice/game_system/YearZeroEngine.rb +134 -0
- data/lib/bcdice/game_system/ZettaiReido.rb +142 -0
- data/lib/bcdice/game_system/meikyu_kingdom/item_table.rb +383 -0
- data/lib/bcdice/game_system/meikyu_kingdom/kingdom_name_table.rb +89 -0
- data/lib/bcdice/game_system/meikyu_kingdom/landscape_table.rb +196 -0
- data/lib/bcdice/game_system/meikyu_kingdom/name_tables.rb +223 -0
- data/lib/bcdice/game_system/meikyu_kingdom/placename_table.rb +214 -0
- data/lib/bcdice/game_system/meikyu_kingdom/tables.rb +610 -0
- data/lib/bcdice/game_system/meikyu_kingdom/word_table.rb +117 -0
- data/lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb +380 -0
- data/lib/bcdice/game_system/meikyu_kingdom_basic/kingdom_table.rb +184 -0
- data/lib/bcdice/game_system/meikyu_kingdom_basic/name_table.rb +417 -0
- data/lib/bcdice/game_system/meikyu_kingdom_basic/table.rb +912 -0
- data/lib/bcdice/game_system/meikyu_kingdom_basic/word_table.rb +121 -0
- data/lib/bcdice/game_system/one_way_heroics/dungeon_table.rb +67 -0
- data/lib/bcdice/game_system/one_way_heroics/random_event_table.rb +166 -0
- data/lib/bcdice/game_system/one_way_heroics/tables.rb +668 -0
- data/lib/bcdice/loader.rb +37 -0
- data/lib/bcdice/normalize.rb +38 -0
- data/lib/bcdice/preprocessor.rb +87 -0
- data/lib/bcdice/randomizer.rb +137 -0
- data/lib/bcdice/repl.rb +155 -0
- data/lib/bcdice/user_defined_dice_table.rb +153 -0
- data/lib/bcdice/version.rb +3 -0
- metadata +304 -0
@@ -0,0 +1,153 @@
|
|
1
|
+
module BCDice
|
2
|
+
# テキストで定義したダイス表を実行するクラス
|
3
|
+
#
|
4
|
+
# @example
|
5
|
+
# text = <<~TEXT
|
6
|
+
# 飲み物表
|
7
|
+
# 1D6
|
8
|
+
# 1:水
|
9
|
+
# 2:緑茶
|
10
|
+
# 3:麦茶
|
11
|
+
# 4:コーラ
|
12
|
+
# 5:オレンジジュース
|
13
|
+
# 6:選ばれし者の知的飲料
|
14
|
+
# TEXT
|
15
|
+
# table = BCDice::UserDefinedDiceTable.new(text)
|
16
|
+
# table.valid?() #=> true
|
17
|
+
# table.roll() #=> "飲み物表(6) > 選ばれし者の知的飲料"
|
18
|
+
#
|
19
|
+
class UserDefinedDiceTable
|
20
|
+
# @param text [String] ダイス表のテキストデータ
|
21
|
+
def initialize(text)
|
22
|
+
@text = text
|
23
|
+
@randomizer = Randomizer.new
|
24
|
+
@rows = nil
|
25
|
+
end
|
26
|
+
|
27
|
+
# @return [Randomizer]
|
28
|
+
attr_accessor :randomizer
|
29
|
+
|
30
|
+
# ダイス表をロールする
|
31
|
+
# @return [String, nil]
|
32
|
+
def roll
|
33
|
+
parse()
|
34
|
+
index = roll_index()
|
35
|
+
unless index
|
36
|
+
return nil
|
37
|
+
end
|
38
|
+
|
39
|
+
key = "#{index}:"
|
40
|
+
row = @rows.find { |l| l.start_with?(key) }
|
41
|
+
unless row
|
42
|
+
return nil
|
43
|
+
end
|
44
|
+
|
45
|
+
chosen = row.delete_prefix(key).gsub('\n', "\n").strip
|
46
|
+
return "#{@name}(#{index}) > #{chosen}"
|
47
|
+
end
|
48
|
+
|
49
|
+
# 有効なダイス表かをチェックする。テキスト形式のミスだけではなく、抜けている出目や範囲外の出目がないか確認する。
|
50
|
+
# @return [Boolean]
|
51
|
+
def valid?
|
52
|
+
parse()
|
53
|
+
|
54
|
+
has_index = @rows.all? { |row| /^\d+:/.match?(row) }
|
55
|
+
unless has_index
|
56
|
+
return false
|
57
|
+
end
|
58
|
+
|
59
|
+
index_list = @rows.map(&:to_i).uniq.sort
|
60
|
+
|
61
|
+
case @type
|
62
|
+
when /^\d+D\d+$/
|
63
|
+
valid_d?(index_list)
|
64
|
+
when "D66", "D66N"
|
65
|
+
valid_d66?(index_list)
|
66
|
+
when "D66A", "D66S"
|
67
|
+
valid_d66_asc_sort?(index_list)
|
68
|
+
when "D66D"
|
69
|
+
valid_d66_desc_sort?(index_list)
|
70
|
+
else
|
71
|
+
false
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
private
|
76
|
+
|
77
|
+
# @return [Integer, nil]
|
78
|
+
def roll_index
|
79
|
+
if (m = /^(\d+)D(\d+)$/.match(@type))
|
80
|
+
times = m[1].to_i
|
81
|
+
sides = m[2].to_i
|
82
|
+
return @randomizer.roll_sum(times, sides)
|
83
|
+
end
|
84
|
+
|
85
|
+
case @type
|
86
|
+
when "D66", "D66N"
|
87
|
+
@randomizer.roll_d66(D66SortType::NO_SORT)
|
88
|
+
when "D66A", "D66S"
|
89
|
+
@randomizer.roll_d66(D66SortType::ASC)
|
90
|
+
when "D66D"
|
91
|
+
@randomizer.roll_d66(D66SortType::DESC)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def parse
|
96
|
+
return if @rows
|
97
|
+
|
98
|
+
lines = @text.split(/\R/).map(&:rstrip).reject(&:empty?)
|
99
|
+
@name = lines.shift
|
100
|
+
@type = lines.shift.upcase
|
101
|
+
@rows = lines
|
102
|
+
end
|
103
|
+
|
104
|
+
def valid_d?(index_list)
|
105
|
+
m = /^(\d+)D(\d+)$/.match(@type)
|
106
|
+
times = m[1].to_i
|
107
|
+
sides = m[2].to_i
|
108
|
+
|
109
|
+
expected_size = times * sides - times + 1
|
110
|
+
if index_list.size != expected_size
|
111
|
+
return false
|
112
|
+
end
|
113
|
+
|
114
|
+
return index_list.first == times && index_list.last == times * sides
|
115
|
+
end
|
116
|
+
|
117
|
+
def valid_d66?(index_list)
|
118
|
+
if index_list.size != 36
|
119
|
+
return false
|
120
|
+
end
|
121
|
+
|
122
|
+
expected_index = (1..6).map do |tens|
|
123
|
+
(1..6).map { |ones| tens * 10 + ones }
|
124
|
+
end.flatten
|
125
|
+
|
126
|
+
return index_list == expected_index
|
127
|
+
end
|
128
|
+
|
129
|
+
def valid_d66_asc_sort?(index_list)
|
130
|
+
if index_list.size != 21
|
131
|
+
return false
|
132
|
+
end
|
133
|
+
|
134
|
+
expected_index = (1..6).map do |tens|
|
135
|
+
(tens..6).map { |ones| tens * 10 + ones }
|
136
|
+
end.flatten
|
137
|
+
|
138
|
+
return index_list == expected_index
|
139
|
+
end
|
140
|
+
|
141
|
+
def valid_d66_desc_sort?(index_list)
|
142
|
+
if index_list.size != 21
|
143
|
+
return false
|
144
|
+
end
|
145
|
+
|
146
|
+
expected_index = (1..6).map do |ones|
|
147
|
+
(ones..6).map { |tens| tens * 10 + ones }
|
148
|
+
end.flatten.sort
|
149
|
+
|
150
|
+
return index_list == expected_index
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
metadata
ADDED
@@ -0,0 +1,304 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bcdice
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.0.pre.alpha.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- SAKATA Sinji
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-10-05 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: BCDice is a rolling dice engine for TRPG
|
14
|
+
email:
|
15
|
+
- ysakasin@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".editorconfig"
|
21
|
+
- ".github/.codecov.yaml"
|
22
|
+
- ".github/workflows/coverage.yaml"
|
23
|
+
- ".github/workflows/lint.yaml"
|
24
|
+
- ".github/workflows/test.yml"
|
25
|
+
- ".gitignore"
|
26
|
+
- ".rubocop.yml"
|
27
|
+
- ".rubocop_todo.yml"
|
28
|
+
- CHANGELOG.md
|
29
|
+
- Gemfile
|
30
|
+
- LICENSE
|
31
|
+
- README.md
|
32
|
+
- ROADMAP.md
|
33
|
+
- Rakefile
|
34
|
+
- bcdice.gemspec
|
35
|
+
- bin/repl.rb
|
36
|
+
- docs/README.txt
|
37
|
+
- docs/dicebot_sort_key.md
|
38
|
+
- docs/how_to_make_dicebot.md
|
39
|
+
- lib/bcdice.rb
|
40
|
+
- lib/bcdice/arithmetic_evaluator.rb
|
41
|
+
- lib/bcdice/base.rb
|
42
|
+
- lib/bcdice/command_parser.rb
|
43
|
+
- lib/bcdice/common_command.rb
|
44
|
+
- lib/bcdice/common_command/add_dice.rb
|
45
|
+
- lib/bcdice/common_command/add_dice/node.rb
|
46
|
+
- lib/bcdice/common_command/add_dice/parser.rb
|
47
|
+
- lib/bcdice/common_command/add_dice/randomizer.rb
|
48
|
+
- lib/bcdice/common_command/barabara_dice.rb
|
49
|
+
- lib/bcdice/common_command/calc.rb
|
50
|
+
- lib/bcdice/common_command/choice.rb
|
51
|
+
- lib/bcdice/common_command/d66_dice.rb
|
52
|
+
- lib/bcdice/common_command/reroll_dice.rb
|
53
|
+
- lib/bcdice/common_command/upper_dice.rb
|
54
|
+
- lib/bcdice/common_command/version.rb
|
55
|
+
- lib/bcdice/dice_table.rb
|
56
|
+
- lib/bcdice/dice_table/chain_table.rb
|
57
|
+
- lib/bcdice/dice_table/d66_grid_table.rb
|
58
|
+
- lib/bcdice/dice_table/d66_range_table.rb
|
59
|
+
- lib/bcdice/dice_table/d66_table.rb
|
60
|
+
- lib/bcdice/dice_table/range_table.rb
|
61
|
+
- lib/bcdice/dice_table/roll_result.rb
|
62
|
+
- lib/bcdice/dice_table/sai_fic_skill_table.rb
|
63
|
+
- lib/bcdice/dice_table/table.rb
|
64
|
+
- lib/bcdice/enum.rb
|
65
|
+
- lib/bcdice/format.rb
|
66
|
+
- lib/bcdice/game_system.rb
|
67
|
+
- lib/bcdice/game_system/AFF2e.rb
|
68
|
+
- lib/bcdice/game_system/AceKillerGene.rb
|
69
|
+
- lib/bcdice/game_system/Airgetlamh.rb
|
70
|
+
- lib/bcdice/game_system/Alsetto.rb
|
71
|
+
- lib/bcdice/game_system/Alshard.rb
|
72
|
+
- lib/bcdice/game_system/AlterRaise.rb
|
73
|
+
- lib/bcdice/game_system/Amadeus.rb
|
74
|
+
- lib/bcdice/game_system/Amadeus_Korean.rb
|
75
|
+
- lib/bcdice/game_system/AnimaAnimus.rb
|
76
|
+
- lib/bcdice/game_system/Arianrhod.rb
|
77
|
+
- lib/bcdice/game_system/ArsMagica.rb
|
78
|
+
- lib/bcdice/game_system/Avandner.rb
|
79
|
+
- lib/bcdice/game_system/BBN.rb
|
80
|
+
- lib/bcdice/game_system/BadLife.rb
|
81
|
+
- lib/bcdice/game_system/BarnaKronika.rb
|
82
|
+
- lib/bcdice/game_system/BattleTech.rb
|
83
|
+
- lib/bcdice/game_system/BeastBindTrinity.rb
|
84
|
+
- lib/bcdice/game_system/BeginningIdol.rb
|
85
|
+
- lib/bcdice/game_system/BeginningIdol_Korean.rb
|
86
|
+
- lib/bcdice/game_system/BladeOfArcana.rb
|
87
|
+
- lib/bcdice/game_system/BlindMythos.rb
|
88
|
+
- lib/bcdice/game_system/BloodCrusade.rb
|
89
|
+
- lib/bcdice/game_system/BloodMoon.rb
|
90
|
+
- lib/bcdice/game_system/CardRanker.rb
|
91
|
+
- lib/bcdice/game_system/ChaosFlare.rb
|
92
|
+
- lib/bcdice/game_system/Chill.rb
|
93
|
+
- lib/bcdice/game_system/Chill3.rb
|
94
|
+
- lib/bcdice/game_system/CodeLayerd.rb
|
95
|
+
- lib/bcdice/game_system/ColossalHunter.rb
|
96
|
+
- lib/bcdice/game_system/CrashWorld.rb
|
97
|
+
- lib/bcdice/game_system/Cthulhu.rb
|
98
|
+
- lib/bcdice/game_system/Cthulhu7th.rb
|
99
|
+
- lib/bcdice/game_system/Cthulhu7th_ChineseTraditional.rb
|
100
|
+
- lib/bcdice/game_system/Cthulhu7th_Korean.rb
|
101
|
+
- lib/bcdice/game_system/CthulhuTech.rb
|
102
|
+
- lib/bcdice/game_system/Cthulhu_ChineseTraditional.rb
|
103
|
+
- lib/bcdice/game_system/Cthulhu_Korean.rb
|
104
|
+
- lib/bcdice/game_system/DarkBlaze.rb
|
105
|
+
- lib/bcdice/game_system/DarkDaysDrive.rb
|
106
|
+
- lib/bcdice/game_system/DarkSouls.rb
|
107
|
+
- lib/bcdice/game_system/DeadlineHeroes.rb
|
108
|
+
- lib/bcdice/game_system/DemonParasite.rb
|
109
|
+
- lib/bcdice/game_system/DetatokoSaga.rb
|
110
|
+
- lib/bcdice/game_system/DetatokoSaga_Korean.rb
|
111
|
+
- lib/bcdice/game_system/DiceBot.rb
|
112
|
+
- lib/bcdice/game_system/DiceOfTheDead.rb
|
113
|
+
- lib/bcdice/game_system/DoubleCross.rb
|
114
|
+
- lib/bcdice/game_system/DoubleCross_Korean.rb
|
115
|
+
- lib/bcdice/game_system/Dracurouge.rb
|
116
|
+
- lib/bcdice/game_system/Dracurouge_Korean.rb
|
117
|
+
- lib/bcdice/game_system/DungeonsAndDragons.rb
|
118
|
+
- lib/bcdice/game_system/EarthDawn.rb
|
119
|
+
- lib/bcdice/game_system/EarthDawn3.rb
|
120
|
+
- lib/bcdice/game_system/EarthDawn4.rb
|
121
|
+
- lib/bcdice/game_system/EclipsePhase.rb
|
122
|
+
- lib/bcdice/game_system/Elric.rb
|
123
|
+
- lib/bcdice/game_system/Elysion.rb
|
124
|
+
- lib/bcdice/game_system/EmbryoMachine.rb
|
125
|
+
- lib/bcdice/game_system/EndBreaker.rb
|
126
|
+
- lib/bcdice/game_system/EtrianOdysseySRS.rb
|
127
|
+
- lib/bcdice/game_system/Fiasco.rb
|
128
|
+
- lib/bcdice/game_system/Fiasco_Korean.rb
|
129
|
+
- lib/bcdice/game_system/FilledWith.rb
|
130
|
+
- lib/bcdice/game_system/FullMetalPanic.rb
|
131
|
+
- lib/bcdice/game_system/FutariSousa.rb
|
132
|
+
- lib/bcdice/game_system/FutariSousa_Korean.rb
|
133
|
+
- lib/bcdice/game_system/Garako.rb
|
134
|
+
- lib/bcdice/game_system/GardenOrder.rb
|
135
|
+
- lib/bcdice/game_system/GehennaAn.rb
|
136
|
+
- lib/bcdice/game_system/GeishaGirlwithKatana.rb
|
137
|
+
- lib/bcdice/game_system/GoblinSlayer.rb
|
138
|
+
- lib/bcdice/game_system/GoldenSkyStories.rb
|
139
|
+
- lib/bcdice/game_system/Gorilla.rb
|
140
|
+
- lib/bcdice/game_system/GranCrest.rb
|
141
|
+
- lib/bcdice/game_system/Gundog.rb
|
142
|
+
- lib/bcdice/game_system/GundogRevised.rb
|
143
|
+
- lib/bcdice/game_system/GundogZero.rb
|
144
|
+
- lib/bcdice/game_system/Gurps.rb
|
145
|
+
- lib/bcdice/game_system/GurpsFW.rb
|
146
|
+
- lib/bcdice/game_system/HarnMaster.rb
|
147
|
+
- lib/bcdice/game_system/HatsuneMiku.rb
|
148
|
+
- lib/bcdice/game_system/Hieizan.rb
|
149
|
+
- lib/bcdice/game_system/HouraiGakuen.rb
|
150
|
+
- lib/bcdice/game_system/HuntersMoon.rb
|
151
|
+
- lib/bcdice/game_system/Illusio.rb
|
152
|
+
- lib/bcdice/game_system/InfiniteFantasia.rb
|
153
|
+
- lib/bcdice/game_system/Insane.rb
|
154
|
+
- lib/bcdice/game_system/Insane_Korean.rb
|
155
|
+
- lib/bcdice/game_system/IthaWenUa.rb
|
156
|
+
- lib/bcdice/game_system/JamesBond.rb
|
157
|
+
- lib/bcdice/game_system/Kamigakari.rb
|
158
|
+
- lib/bcdice/game_system/Kamigakari_Korean.rb
|
159
|
+
- lib/bcdice/game_system/KanColle.rb
|
160
|
+
- lib/bcdice/game_system/KemonoNoMori.rb
|
161
|
+
- lib/bcdice/game_system/KillDeathBusiness.rb
|
162
|
+
- lib/bcdice/game_system/KillDeathBusiness_Korean.rb
|
163
|
+
- lib/bcdice/game_system/KurayamiCrying.rb
|
164
|
+
- lib/bcdice/game_system/LiveraDoll.rb
|
165
|
+
- lib/bcdice/game_system/LogHorizon.rb
|
166
|
+
- lib/bcdice/game_system/LogHorizon_Korean.rb
|
167
|
+
- lib/bcdice/game_system/LostRecord.rb
|
168
|
+
- lib/bcdice/game_system/LostRoyal.rb
|
169
|
+
- lib/bcdice/game_system/MagicaLogia.rb
|
170
|
+
- lib/bcdice/game_system/MeikyuDays.rb
|
171
|
+
- lib/bcdice/game_system/MeikyuKingdom.rb
|
172
|
+
- lib/bcdice/game_system/MeikyuKingdomBasic.rb
|
173
|
+
- lib/bcdice/game_system/MetalHead.rb
|
174
|
+
- lib/bcdice/game_system/MetalHeadExtream.rb
|
175
|
+
- lib/bcdice/game_system/MetallicGuardian.rb
|
176
|
+
- lib/bcdice/game_system/MonotoneMuseum.rb
|
177
|
+
- lib/bcdice/game_system/MonotoneMuseum_Korean.rb
|
178
|
+
- lib/bcdice/game_system/Nechronica.rb
|
179
|
+
- lib/bcdice/game_system/Nechronica_Korean.rb
|
180
|
+
- lib/bcdice/game_system/NeverCloud.rb
|
181
|
+
- lib/bcdice/game_system/NightWizard.rb
|
182
|
+
- lib/bcdice/game_system/NightWizard3rd.rb
|
183
|
+
- lib/bcdice/game_system/NightmareHunterDeep.rb
|
184
|
+
- lib/bcdice/game_system/NinjaSlayer.rb
|
185
|
+
- lib/bcdice/game_system/NjslyrBattle.rb
|
186
|
+
- lib/bcdice/game_system/Nuekagami.rb
|
187
|
+
- lib/bcdice/game_system/OneWayHeroics.rb
|
188
|
+
- lib/bcdice/game_system/OracleEngine.rb
|
189
|
+
- lib/bcdice/game_system/OrgaRain.rb
|
190
|
+
- lib/bcdice/game_system/Oukahoushin3rd.rb
|
191
|
+
- lib/bcdice/game_system/Paradiso.rb
|
192
|
+
- lib/bcdice/game_system/Paranoia.rb
|
193
|
+
- lib/bcdice/game_system/ParanoiaRebooted.rb
|
194
|
+
- lib/bcdice/game_system/ParasiteBlood.rb
|
195
|
+
- lib/bcdice/game_system/Pathfinder.rb
|
196
|
+
- lib/bcdice/game_system/Peekaboo.rb
|
197
|
+
- lib/bcdice/game_system/Pendragon.rb
|
198
|
+
- lib/bcdice/game_system/PhantasmAdventure.rb
|
199
|
+
- lib/bcdice/game_system/Postman.rb
|
200
|
+
- lib/bcdice/game_system/PulpCthulhu.rb
|
201
|
+
- lib/bcdice/game_system/Raisondetre.rb
|
202
|
+
- lib/bcdice/game_system/RecordOfLodossWar.rb
|
203
|
+
- lib/bcdice/game_system/RecordOfSteam.rb
|
204
|
+
- lib/bcdice/game_system/RokumonSekai2.rb
|
205
|
+
- lib/bcdice/game_system/RoleMaster.rb
|
206
|
+
- lib/bcdice/game_system/RuneQuest.rb
|
207
|
+
- lib/bcdice/game_system/RyuTuber.rb
|
208
|
+
- lib/bcdice/game_system/Ryutama.rb
|
209
|
+
- lib/bcdice/game_system/SRS.rb
|
210
|
+
- lib/bcdice/game_system/SamsaraBallad.rb
|
211
|
+
- lib/bcdice/game_system/Satasupe.rb
|
212
|
+
- lib/bcdice/game_system/ScreamHighSchool.rb
|
213
|
+
- lib/bcdice/game_system/SevenFortressMobius.rb
|
214
|
+
- lib/bcdice/game_system/ShadowRun.rb
|
215
|
+
- lib/bcdice/game_system/ShadowRun4.rb
|
216
|
+
- lib/bcdice/game_system/ShadowRun5.rb
|
217
|
+
- lib/bcdice/game_system/SharedFantasia.rb
|
218
|
+
- lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb
|
219
|
+
- lib/bcdice/game_system/ShinkuuGakuen.rb
|
220
|
+
- lib/bcdice/game_system/ShinobiGami.rb
|
221
|
+
- lib/bcdice/game_system/ShoujoTenrankai.rb
|
222
|
+
- lib/bcdice/game_system/Skynauts.rb
|
223
|
+
- lib/bcdice/game_system/SteamPunkers.rb
|
224
|
+
- lib/bcdice/game_system/StellarKnights.rb
|
225
|
+
- lib/bcdice/game_system/SterileLife.rb
|
226
|
+
- lib/bcdice/game_system/StrangerOfSwordCity.rb
|
227
|
+
- lib/bcdice/game_system/StratoShout.rb
|
228
|
+
- lib/bcdice/game_system/StratoShout_Korean.rb
|
229
|
+
- lib/bcdice/game_system/Strave.rb
|
230
|
+
- lib/bcdice/game_system/SwordWorld.rb
|
231
|
+
- lib/bcdice/game_system/SwordWorld2_0.rb
|
232
|
+
- lib/bcdice/game_system/SwordWorld2_5.rb
|
233
|
+
- lib/bcdice/game_system/TherapieSein.rb
|
234
|
+
- lib/bcdice/game_system/TokumeiTenkousei.rb
|
235
|
+
- lib/bcdice/game_system/TokyoGhostResearch.rb
|
236
|
+
- lib/bcdice/game_system/TokyoNova.rb
|
237
|
+
- lib/bcdice/game_system/Torg.rb
|
238
|
+
- lib/bcdice/game_system/Torg1_5.rb
|
239
|
+
- lib/bcdice/game_system/TorgEternity.rb
|
240
|
+
- lib/bcdice/game_system/TrinitySeven.rb
|
241
|
+
- lib/bcdice/game_system/TunnelsAndTrolls.rb
|
242
|
+
- lib/bcdice/game_system/TwilightGunsmoke.rb
|
243
|
+
- lib/bcdice/game_system/Utakaze.rb
|
244
|
+
- lib/bcdice/game_system/VampireTheMasquerade5th.rb
|
245
|
+
- lib/bcdice/game_system/Villaciel.rb
|
246
|
+
- lib/bcdice/game_system/WARPS.rb
|
247
|
+
- lib/bcdice/game_system/WaresBlade.rb
|
248
|
+
- lib/bcdice/game_system/Warhammer.rb
|
249
|
+
- lib/bcdice/game_system/WitchQuest.rb
|
250
|
+
- lib/bcdice/game_system/WorldOfDarkness.rb
|
251
|
+
- lib/bcdice/game_system/YankeeYogSothoth.rb
|
252
|
+
- lib/bcdice/game_system/YearZeroEngine.rb
|
253
|
+
- lib/bcdice/game_system/ZettaiReido.rb
|
254
|
+
- lib/bcdice/game_system/meikyu_kingdom/item_table.rb
|
255
|
+
- lib/bcdice/game_system/meikyu_kingdom/kingdom_name_table.rb
|
256
|
+
- lib/bcdice/game_system/meikyu_kingdom/landscape_table.rb
|
257
|
+
- lib/bcdice/game_system/meikyu_kingdom/name_tables.rb
|
258
|
+
- lib/bcdice/game_system/meikyu_kingdom/placename_table.rb
|
259
|
+
- lib/bcdice/game_system/meikyu_kingdom/tables.rb
|
260
|
+
- lib/bcdice/game_system/meikyu_kingdom/word_table.rb
|
261
|
+
- lib/bcdice/game_system/meikyu_kingdom_basic/item_table.rb
|
262
|
+
- lib/bcdice/game_system/meikyu_kingdom_basic/kingdom_table.rb
|
263
|
+
- lib/bcdice/game_system/meikyu_kingdom_basic/name_table.rb
|
264
|
+
- lib/bcdice/game_system/meikyu_kingdom_basic/table.rb
|
265
|
+
- lib/bcdice/game_system/meikyu_kingdom_basic/word_table.rb
|
266
|
+
- lib/bcdice/game_system/one_way_heroics/dungeon_table.rb
|
267
|
+
- lib/bcdice/game_system/one_way_heroics/random_event_table.rb
|
268
|
+
- lib/bcdice/game_system/one_way_heroics/tables.rb
|
269
|
+
- lib/bcdice/loader.rb
|
270
|
+
- lib/bcdice/normalize.rb
|
271
|
+
- lib/bcdice/preprocessor.rb
|
272
|
+
- lib/bcdice/randomizer.rb
|
273
|
+
- lib/bcdice/repl.rb
|
274
|
+
- lib/bcdice/user_defined_dice_table.rb
|
275
|
+
- lib/bcdice/version.rb
|
276
|
+
homepage: https://bcdice.org
|
277
|
+
licenses:
|
278
|
+
- MIT
|
279
|
+
metadata:
|
280
|
+
allowed_push_host: https://rubygems.org/
|
281
|
+
homepage_uri: https://bcdice.org
|
282
|
+
source_code_uri: https://github.com/bcdice/BCDice
|
283
|
+
changelog_uri: https://github.com/bcdice/BCDice/blob/master/CHANGELOG.md
|
284
|
+
post_install_message:
|
285
|
+
rdoc_options: []
|
286
|
+
require_paths:
|
287
|
+
- lib
|
288
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
289
|
+
requirements:
|
290
|
+
- - ">="
|
291
|
+
- !ruby/object:Gem::Version
|
292
|
+
version: '2.5'
|
293
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
294
|
+
requirements:
|
295
|
+
- - ">"
|
296
|
+
- !ruby/object:Gem::Version
|
297
|
+
version: 1.3.1
|
298
|
+
requirements: []
|
299
|
+
rubyforge_project:
|
300
|
+
rubygems_version: 2.7.6.2
|
301
|
+
signing_key:
|
302
|
+
specification_version: 4
|
303
|
+
summary: BCDice is a rolling dice engine for TRPG
|
304
|
+
test_files: []
|