❌

Reading view

There are new articles available, click to refresh the page.

A 3D Printed Marble Clock, but it’s Scrolling Text

With the topic of marble clocks having been quite well explored at this point, it raises the question of how easy it would be to take the basic principle and create a text display using black and white marbles. As [Ivan Miranda] found out in a recent marble text scroller project, this is far from easy.

The reason why a scrolling text display was picked comes down to not wanting to be limited to a fixed number of digits. This resulted in a round wheel design, with inner steel ball bearings and a stepper motor on both the wheel and an inner selector mechanism. These respectively align the marble channels and pick the right color of marbles to be dropped into any of the wheel’s slots, creating the right sequence of marbles for the target text.

Perhaps the most amazing thing about it is that it’s an absolutely massive structure, yet it’s all 3D printed and bolted together. It took a number of trial-and-error cycles, and debugging issues like the IR sensors getting confused by daylight, but it now mostly seems to work all right.

There are still some remaining issues, such as having to manually home the wheel before starting, and the ratio of black vs white marbles can cause unexpected gaps in the final text. Despite this the text is quite legible and definitely infinite.

Visualize Regular Expressions with Marbles

If you are one of those people who visualize things physically better than in the abstract, then Regex Marble Run by [bottomless] might be for you. You enter a test expression and a string, and the site generates a virtual marble machine that lets you see the regular expression pick apart the string in a physical way.

Click this link, and you’ll see the regular expression β€œ^[hH]ack.[dD][^0-9]*$” which, if you aren’t a regular expression user, might seem a bit cryptic. However, it is fairly simple if you take it bit-by-bit.

The caret character tells it to match the start of the string. So β€œ^dog” will match β€œdog” and β€œdog food” but won’t match β€œfood for a dog.” The following bit β€œ[hH]” will match either β€œh” or β€œH”. Then there is β€œack” which is just what you think it is. So a string starting with β€œhack” or β€œHack” might match (depending on the rest of the expression.

The period means match any single character. Then there’s another β€œ[]” but this time with β€œdD” to match any kind of D. The next β€œ[]” character class is a range from 0-9, but since there is a caret, the match is negated. So β€œ[^0-9]” means match anything except a digit from 0 to 9. The β€œ*” means we can have zero or more of these. So β€œHackxD” matches, but so does β€œHackxDXYZabc” for now. Trick question: Does β€œHackxDXYZabc123” match? So far, yes, but it only matches to the lowercase β€œc” character.

The final character, β€œ$” means end of string. So now β€œHackxDXYZabc123” does not match because we are still in the middle of the string. However, β€œHackxDXYZabc” will match since the previous β€œ*” β€œate” the rest of the string.

Head spinning? The site will let you see each letter of a test string as a marble that falls through the different parts of the regular expression. Balls that pass wind up in the left-hand box, while failures are in the right-hand box. Will it help you? We don’t know, but it is fun to watch.

Want a refresher on regular expressions? Or perhaps you want some practice?

❌