diff --git a/ui.nim b/ui.nim index 8bdc688..2a004b3 100644 --- a/ui.nim +++ b/ui.nim @@ -2,22 +2,12 @@ import os, math, strutils, strformat import fixedseq, game, simulation -const help = - """cup - Probability calculator for the board game CamelUp - -Usage: - cup [-i] SPACE:STACK [...SPACE:STACK] [DICE] - -SPACE refers to a numbered board space (1-16). -STACK refers to a stack of camel colors from bottom to top, e.g. - YBR (Yellow, Blue, Red, with Red on top). -DICE refers to the set of dice that have already been rolled, - e.g. GPR (Green, Purple, Red) - -Options: - -i Interactive mode (currently unimplemented) - -h Show this message and exit -""" +const help = block: + # can't use regex, fortunately we are looking for a straightforward separator + let readme = slurp("./README.md") + let endPos = rfind(readme, "```") - 1 + let startPos = rfind(readme, "```", last = endPos) + 4 + readme[startPos..endPos] # =============================