From 97ad992e98ba4c0ef18f0d3f6768a7f4a9ecae05 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sun, 7 Feb 2021 04:29:32 +0100 Subject: Update documentation --- HelpMe.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'HelpMe.md') diff --git a/HelpMe.md b/HelpMe.md index 626bacc..f74540f 100644 --- a/HelpMe.md +++ b/HelpMe.md @@ -25,6 +25,7 @@ * [Unique](#unique) * [All The same](#allsame) * [Value list](#Value-list) + * [Switch/Case](#Switch-case) * [Comment (\#)](#comment-) * [Functions](#Functions) * [Managing the output](#the-output) @@ -559,6 +560,27 @@ Then, the final output will be: `{7,3}` and `{6,4}` are group, and `[2]` is left aside. +### Switch case (S) + +Switch case operator allows you to transform number value into text. +Its goal is to make that easier than using several if. As you may expect, its syntax is close to if. + +``` +1d100S[<50]{"Low"}[>=50]{"Low"} +``` + +You may also add a default option + +``` +1d4S[=1]{"Low"}[=2]{"small"}[=3]{"medium"}{"big"} +``` + +Exclusive mode: +This mode is enabled when a `^` is following the `S`. +``` +1d100S^[<25]{"Low"}[<50]{"small"}[<75]{"medium"}[>=75]{"big"} +``` + ### Comment (\#) ``` -- cgit v1.2.3-70-g09d2