-
Notifications
You must be signed in to change notification settings - Fork 0
Loops, Cycles, and Rulesets, a Comprehensive Explanation
Loops, Cycles, and Rulesets are at the core of CT. This article is supposed to give someone who wants to start creating and editing their own rulesets.
A loop is a series of symbols that CT reads from. Cycling through that loop is what gives you the power to type whatever you want.
Let's start with a super basic loop: a → b → c → d.
In this scenario, each letter, "a" through "d", is a symbol. Using a cycle, you can go from one to the other. With CT, when you type an "a" on your keyboard, you can cycle that character after (or before) typing to transform it into a "b", and then a "c", and then "d", and once you reach the end, you will cycle back around to "a".
This isn't very useful though, because you can type each of these characters on a normal keyboard. How about this loop: a → ɑ → æ → ɐ → ɒ?
That's a lot more useful. Now by cycling through from an "a", I can type any of those symbols without copy-pasting them. For me and on my keyboard, that's infinitely easier. In this example, the "a" is called the entry symbol. There's nothing technically special about the symbol. If you have a symbol "æ" on your keyboard, you can totally enter the loop from that symbol. The only reason it is special is it gets displayed differently than any other symbol in the loop when looking at the reference. In this wiki, all loops written will start with the entry symbol.
Note
Symbols in the same loop (for the most part) can have different lengths, and they can be longer than one character. This loop is perfectly fine: The → Quick → Brown → Fox → Pneumonoultramicroscopicsilicovolcanoconiosis.
Replacements are a special type of loop. They only allow two symbols in a loop, and any cycling operation does not cycle back to the beginning, hence the name "replacements." One use case for this is typing emojis. One replacement loop could look like this: :sob → 😭. You could also use it as an X-SAMPA to IPA converter, turning "B\" into "ʙ" with the rule B\ → ʙ.
A few cycle types can only use replacements, due to the indistinguishability of continuing to type a symbol versus attempting to cycle through the loop with that symbol.
Replacements are the same as normal loops apart from the exceptions described above.
A Cycle is a function that you can call when typing. Different kinds of cycle types can do different things.
Here is the current list of all types of cycles:
- There are currently no cycle modes.
A ruleset is basically a set of loops. CT Can load 1 ruleset at a time, and if that inhibits you, it's time to create your own!
A ruleset has a title and a list of sections. Each of these sections has a name and a list of loops. The entire ruleset is written as a .yaml file, as such:
title: Arrows
layers: 2
sections:
Arrows:
- n: [">", →, ↦, ↣, ⇁, ⇀]
- r: [">", →]
- n: [<, ←, ↤, ↢, ↽, ↼]
- r: [<, ←]
- n: [^, ↑, ↥, ↿, ↾]
- r: [^, ↑]
- n: [., ↓, ↧, ⇃, ⇂]
- r: [., ↓]
- N: [h, ↔, ↭, ⇼]
- N: [v, ↕]
- 1n: [">", ⇒, ⇉, ⇏, ⇛, ⇝]
- 1n: [<, ⇐, ⇇, ⇍, ⇚, ⇜]
- 1n: [^, ⇑, ⇈]
- 1n: [., ⇓, ⇊]
- 1N: [h, ⇄, ⇆, ⇋, ⇌, ⇎, ⇔]
- 1N: [v, ⇅, ⇵, ⇕]
- n: ["@", ↪, ↩, ↺, ↻, ↶, ↷,]
Spinner:
- n: ["#", ↑, ↗, →, ↘, ↓, ↙, ←, ↖]
- 1n: ["#", ⇑, ⇗, ⇒, ⇘, ⇓ , ⇙, ⇐, ⇖]
Tip
For a quick tutorial/refresher on YAML, there are quick tutorials online, or check out this refrence.
Here's a breakdown of the previous code:
Pretty self-explanatory. The title gives the user a clear indication of what the ruleset is about. Titles have no effect on the loops in the ruleset.
This attribute tells CT how many layers of loops it has.
The sections field is the meat of the file. It consists of an object (key-value pair) of individual sections:
Each key-value pair in the sections field denotes a section in the final ruleset. These sections also do not serve a purpose, other than dividing up the reference into smaller sections/tabs. In each section is a list of loop objects.
A loop object is what the program reads, and it turns them into loops on their end. A loop consists of a key and value. The key tells CT what kind of loop it is, and the value (the list) is the symbols in each loop.
The current list of keys is as follows:
-
n: This is the normal key. The value to that key will be treated as a normal loop. -
r: This key tells CT that the corresponding loop is a replacement loop. The corresponding loop should only have two symbols in it, or else CT will throw an error.
Each of these loops can:
- be CAPITALIZED. This tells CT that the following loop is case sensitive. Without it, CT will look for lower or uppercase versions of any of the symbols in the loop.
- be proceeded by a number. This tells CT that the loop belongs to that layer. The layer number is 0-indexed, and if there is no number, it is treated as on the 0th layer.