foyer

journal

totes

Playing around with multiset rewriting today using Tote. Here are some little sequences I made during work breaks hehe.

tally

A very simple tally counter. You can use the evaluation buttons to increment and decrement.

rewriting sequence in Tote showing a tally counter
tally counter, going forwards
view GIF
rewriting sequence in Tote showing a tally counter in reverse
tally counter, going backwards
view GIF
5 5 5 5 -> 1 # optional limiter, you can totes like keep counting

# increment

# to support subtraction of tally, we have
# to prioritise the reverse evaluation of 5 -> 4
4 -> 5

1 -> 2
2 -> 3
4 -> 5

# push 5 to stack and spawn in
# another 1 to start another cycle
5 -> 1 5

rocket

A rocket launch sequence, made possible with direction setters.

rewriting sequence in Tote showing rocket launch
take your protein pills and put your helmet on
view GIF
# TO SPACE
‖ 🚀 -> ‖ ‖ 🚀
0 -> ‖ # liftoff!
5 -> 4
4 -> 3
3 -> 2
2 -> 1
1 -> 0

Note: this sequence glitches out if run in reverse. The rocket does descend but it burns the countdown.

counter

A rabbit counter that resets at 10 rabbits. I think the rules could be reduced but I’m just not seeing it right now.

rewriting sequence in Tote showing a counter from 1 to 0
counting rabbits
view GIF
# GAAAHH
segments(9) -> 🐇🐇🐇🐇🐇🐇🐇🐇🐇🐇
segments(8) -> 🐇🐇🐇🐇🐇🐇🐇🐇🐇
segments(7) -> 🐇🐇🐇🐇🐇🐇🐇🐇
segments(6) -> 🐇🐇🐇🐇🐇🐇🐇
segments(5) -> 🐇🐇🐇🐇🐇🐇
segments(4) -> 🐇🐇🐇🐇🐇
segments(3) -> 🐇🐇🐇🐇
segments(2) -> 🐇🐇🐇
segments(1) -> 🐇🐇
segments(0) -> 🐇
🐇🐇🐇🐇🐇🐇🐇🐇🐇🐇 -> segments(0)
🐇🐇🐇🐇🐇🐇🐇🐇🐇 -> segments(9)
🐇🐇🐇🐇🐇🐇🐇🐇 -> segments(8)
🐇🐇🐇🐇🐇🐇🐇 -> segments(7)
🐇🐇🐇🐇🐇🐇 -> segments(6)
🐇🐇🐇🐇🐇 -> segments(5)
🐇🐇🐇🐇 -> segments(4)
🐇🐇🐇 -> segments(3)
🐇🐇 -> segments(2)
🐇 -> segments(1)

impressions

It’s quite fun actually. The mechanics are deceptively simple — declare a list of rules, the first matching rule from the top is applied, and start again from the top. However, I’m having a bit of a difficult time thinking with these constraints. Meanwhile, there’s people already doing impressive things with it like this and this. I take one lunch break and Devine made a controller and I’m like…it’s that simple?!

rewrite the way you think -> to rewrite
to rewrite -> rewrite the way you think

Kinda reminds me of Conway’s Game of Life and how people were finding all of these different patterns like beehives, gliders, and pulsars. I think we could and should compile something like that for rewriting (if it doesn’t already exist).

Anyway, I’ll continue updating this page with more things I try.

resources


Oh and speaking of totes, bring a tote bag when you go grocery shopping. Ditch the plastic bags.

Posted on .