Skip to content

Fasterfying Development

Necried edited this page Feb 2, 2019 · 3 revisions

Making our lives easier

So, you've worked with finsm for awhile, and maybe you're starting to like how easy it is to prototype and test your state machines. "Gee, I'm sure glad I don't have to draw all this out on pen and paper everytime." However, you're still not satisfied. Some things should be less of a hassle.

Look no further! You've come to the right place!

Why all the arrows..? (Read: Multiple transitions per arrow)

Let's say you have multiple transitions that goes from State A to State B, and you've drawn many arrows between these two states. You quickly realize that the arrows are slowly crowding the screen.

It turns out that finsm allows you to specify multiple transitions on one arrow label. Now, instead of drawing separate arrows for each transition, you can now input this on a label: multrans

Now the transition above will recognize characters '1', '2' and '3'. If you want to add more transitions between the two states, add a comma followed by the input.

Hold on, commas?!

There is a curious gotcha to all this though: Commas are now so-called "special characters", i.e. finsm treats them as delimiters instead of a normal character. Also, spaces/whitespaces are also considered special; finsm will format your transition labels to look as uniform as possible, and that means modifying your inputs according to certain rules.

Not all is lost though: If you need whitespaces, or commas, or even an epsilon as a character with no special meaning, you just put them in curly braces, for example: "{,}" and "{ }". This now disambiguates them as normal characters!

Tidying up

You may be working with a complicated machine, and states are filling up the screen. However, everything seems to be haphazardly arranged; States don't line up, and arrows aren't as straight or beautifully curved as they should've been.

Fortunately, finsm comes with a "snap-to-grid" command that lines up arrows and states uniformly when moving them around. Pressing the grid button at the bottom-right of the screen toggles this command. Give it a go, move around some states and arrows, and watch the magic happen!

I <3 Keybindings

Usually, a development environment has keyboard shortcuts for commonly used actions. Since there's already a wiki page that lists all available keybindings, we won't cover its contents here, but we encourage you to take a look!