Regular Expressions (RegExes) can be thought of as simple computer programs, but they are just as capable of stumping beginners. Inspired by how block-based languages like Snap! made code more accessible to new programmers, I decided to try doing the same for RegEx patterns. This project provides a (hopefully) easy-to-understand set of blocks that let you build RegExes without worrying about the syntax.
I think maybe you could improve the clarity of the presentation by reducing the number of blocks. For example:
instead of three separate blocks, to clarify that they're variants of the same idea.
But I was sad to look inside your blocks and see that you make Javascript do the work. Regular expression parsing and matching is something that can easily enough be done in Snap! itself, where the code is accessible to learners. Sort of like this: Computer Science Logo Style vol 3 ch 1: Automata Theory
I did not know that you could do dropdowns in custom blocks! That is pretty cool.
The original intent of the project was to help teach how to put RegEx blocks together, so I figured that the JS engine would be fine. But you are right, it would be very good for people to be able to see how the actual engine works, even if it would take a bit of time to implement.
It does make a difference, because on my Mac you type option-C to stop the running program. But if you look on the menu bar there should be a menu named Logo and it'll have options "stop" and "pause" and you can look at the keyboard shortcut shown next to the "stop" one.
edit: Thank you for finding a Logo bug... those lines with the all-caps ACCEPT and REJECT should also be showing what you typed to get to those states.
Oh. Yes it is. I thought that was just on my Mac. I've filed a bug report.
Meanwhile, after loading the program, type
er "fsm1
and then paste this in:
to fsm1 :here
ifelse memberp :here :accept [accept] [reject]
fsm1 (fsmnext :here fsmcheckstop readchar)
end
to fsmcheckstop :char
if :char = "s [throw "toplevel]
op :char
end
And then you can type "s" (just plain s) to stop the game.