# MATH introduce numbers (in unary notation)
# Here we count up from zero, go through some primes, etc. There is some
# syntax around the numbers, but that doesn't need to be understood at
# this point. We give numbers in a tweaked unary format, rather than the
# encoding used in the main body of the message.
☰ ☀⁂ ~
☀⁂ | ⚀ 0 ~
☀⁂ | ⚀ 1 0 ~
☀⁂ | ⚀ 1 1 0 ~
☀⁂ | ⚀ 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀⁂ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☰ ☀□ ~
☀□ | ⚀ 0 ~
☀□ | ⚀ 1 0 ~
☀□ | ⚀ 1 1 1 1 0 ~
☀□ | ⚀ 1 1 1 1 1 1 1 1 1 0 ~
☀□ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀□ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☰ ☀❣ ~
☀❣ | ⚀ 1 1 0 ~
☀❣ | ⚀ 1 1 1 0 ~
☀❣ | ⚀ 1 1 1 1 1 0 ~
☀❣ | ⚀ 1 1 1 1 1 1 1 0 ~
☀❣ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀❣ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀❣ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀❣ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀❣ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀❣ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
☀❣ | ⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 ~
# MATH introduce equality for unary numbers
# The intro operator does nothing essential, and could be omitted - it just
# tags the first use of a new operator. The = operator is introduced
# alongside a duplication of unary numbers. The meaning will not quite by
# nailed down until we see other relational operators.
☰ ☯ ~
☯ (⚀ 1 0) (⚀ 1 0) ~
☯ (⚀ 1 1 0) (⚀ 1 1 0) ~
☯ (⚀ 1 1 1 0) (⚀ 1 1 1 0) ~
☯ (⚀ 1 1 1 1 0) (⚀ 1 1 1 1 0) ~
☯ (⚀ 1 1 1 1 1 0) (⚀ 1 1 1 1 1 0) ~
☯ (⚀ 1 1 1 1 1 1 0) (⚀ 1 1 1 1 1 1 0) ~
☯ (⚀ 1 1 1 1 1 1 1 0) (⚀ 1 1 1 1 1 1 1 0) ~
☯ (⚀ 1 1 1 1 1 1 1 1 0) (⚀ 1 1 1 1 1 1 1 1 0) ~
☯ (⚀ 1 0) (⚀ 1 0) ~
☯ (⚀ 1 1 1 1 1 1 0) (⚀ 1 1 1 1 1 1 0) ~
☯ (⚀ 1 1 0) (⚀ 1 1 0) ~
# MATH now introduce other relational operators
# After this lesson, it should be clear what contexts < > and = are
# appropriate in.
☰ > ~
☰ < ~
☯ (⚀ 1 0) (⚀ 1 0) ~
< (⚀ 1 0) (⚀ 1 1 0) ~
< (⚀ 1 0) (⚀ 1 1 1 0) ~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(⚀ 1 1 1 1 1 1 1 1 1 0) | * (⚀ 1 1 1 0) (⚀ 1 1 1 0) ~
☯ (⚀ 0) | * (⚀ 0) (⚀ 1 0) ~
☯ (⚀ 1 1 1 0) | * (⚀ 1 1 1 0) (⚀ 1 0) ~
☯ (⚀ 0) | * (⚀ 1 1 0) (⚀ 0) ~
☯ (⚀ 0) | * (⚀ 0) (⚀ 1 1 1 0) ~
☯ (⚀ 1 1 1 0) | * (⚀ 1 1 1 0) (⚀ 1 0) ~
☯ (⚀ 1 1 0) | * (⚀ 1 0) (⚀ 1 1 0) ~
☯ (⚀ 0) | * (⚀ 0) (⚀ 0) ~
☯ (⚀ 0) | * (⚀ 1 1 1 0) (⚀ 0) ~
☯ (⚀ 0) | * (⚀ 1 1 0) (⚀ 0) ~
☯ (⚀ 0) | * (⚀ 1 1 1 0) (⚀ 0) ~
# MATH introduce non-unary representation of numbers
# Switch from unary numbers to another representation. The representation
# of numbers is now medium-specific (it used to be specified as binary),
# and can be fiddled with without affecting the rest of the message.
☯ 0 (⚀ 0) ~
☯ 1 (⚀ 1 0) ~
☯ 2 (⚀ 1 1 0) ~
☯ 3 (⚀ 1 1 1 0) ~
☯ 4 (⚀ 1 1 1 1 0) ~
☯ 5 (⚀ 1 1 1 1 1 0) ~
☯ 6 (⚀ 1 1 1 1 1 1 0) ~
☯ 7 (⚀ 1 1 1 1 1 1 1 0) ~
☯ 8 (⚀ 1 1 1 1 1 1 1 1 0) ~
☯ 9 (⚀ 1 1 1 1 1 1 1 1 1 0) ~
☯ 10 (⚀ 1 1 1 1 1 1 1 1 1 1 0) ~
☯ 11 (⚀ 1 1 1 1 1 1 1 1 1 1 1 0) ~
☯ 12 (⚀ 1 1 1 1 1 1 1 1 1 1 1 1 0) ~
☯ 13 (⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 0) ~
☯ 14 (⚀ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0) ~
☯ 15 (⚀ 1 1 1 1 1 1 1 1 1 1 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) 3 ~
✉ ᚋ 3 | ☯ 9 (* (ᚋ) (ᚋ)) ~
✉ ᚋ 4 | ☯ 16 (* (ᚋ) (ᚋ)) ~
✉ ᚋ (+) | ☯ 7 (ᚋ 4 3) ~
✉ ᚋ (+) | ☯ 12 (ᚋ 6 6) ~
✉ ᚋ (+) | ☯ 9 (ᚋ 7 2) ~
✉ ᚋ (-) | ☯ 1 (ᚋ 4 3) ~
✉ ᚋ (-) | ☯ 0 (ᚋ 6 6) ~
✉ ᚋ (-) | ☯ 5 (ᚋ 7 2) ~
✉ ᚋ (*) | ☯ 12 (ᚋ 4 3) ~
✉ ᚋ (*) | ☯ 36 (ᚋ 6 6) ~
✉ ᚋ (*) | ☯ 14 (ᚋ 7 2) ~
✉ ᚋ (☯) | ᚋ 4 4 ~
✉ ᚋ (☯) | ᚋ 4 (+ 2 2) ~
✉ ᚋ 1 | ✉ ᚌ 2 | ☯ 3 (+ (ᚋ) (ᚌ)) ~
✉ ᚋ 2 | ✉ ᚌ 7 | ☯ 5 (- (ᚌ) (ᚋ)) ~
✉ ᚋ (+) | ✉ ᚌ 3 | ☯ 4 (ᚋ 1 (ᚌ)) ~
# Scoping and other odd corners.
☯ 2 | ✉ ᚋ 1 | + $ᚋ 1 ~
☯ 1 | ✉ ᚋ 1 $ᚋ ~
☯ 14 | ✉ ᚋ 1 14 ~
☯ 4 | ✉ ᚋ (✉ ᚌ 3 | + 1 $ᚌ) $ᚋ ~
☯ 4 | ✉ ᚋ (✉ ᚋ 3 | + 1 $ᚋ) $ᚋ ~
# Show alternate lookup syntax.
✉ ᚋ 1 | ☯ (ᚋ) 1 ~
✉ ᚋ 1 | ☯ $ᚋ 1 ~
✉ ᚋ 4 | ☯ 16 (* (ᚋ) (ᚋ)) ~
✉ ᚋ 4 | ☯ 16 (* $ᚋ $ᚋ) ~
✉ ᚋ 4 | ☯ 16 | * $ᚋ $ᚋ ~
# Now for functions.
☯ 0 | (? ᚋ $ᚋ) 0 ~
☯ 1 | (? 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☯ 25 | (? 5 | * $5 $5) 5 ~
# Functions in a box.
✉ ᚋ (? ᚌ | * $ᚌ $ᚌ) | ☯ 25 | ᚋ 5 ~
✉ ᚋ (? ᚌ | + $ᚌ 1) | ☯ 6 | ᚋ 5 ~
✉ ᚋ (? ᚋ | + $ᚋ 1) | ☯ 6 | ᚋ 5 ~
✉ ᚌ (? ᚋ | + $ᚋ 1) | ☯ 6 | ᚌ 5 ~
# Serve some curry.
☯ 52 | * 4 13 ~
☯ 52 | (? ᚋ | * $ᚋ 4) 13 ~
☯ 52 | (? ᚋ | ? ᚌ | * $ᚋ $ᚌ) 13 4 ~
☯ 53 | (? ᚋ | ? ᚌ | + 1 | * $ᚋ $ᚌ) 13 4 ~
✉ ᚍ (? ᚋ | ? ᚌ | + 1 | * $ᚋ $ᚌ) | ☯ 53 | ᚍ 13 4 ~
# MATH demonstrate existence of memory
✉✉ ❄ 39 ~
☯ 39 $❄ ~
☯ $❄ 39 ~
✉✉ ❄ 40 ~
☯ $❄ 40 ~
✉✉ ❄ | + 1 $❄ ~
☯ $❄ 41 ~
✉ ᚋ (+ 1 $❄) | ✉✉ ❄ $ᚋ ~
☯ $❄ 42 ~
✉✉ □ | ? ᚋ | * $ᚋ $ᚋ ~
☯ 9 | □ 3 ~
☯ 81 | □ 9 ~
☯ 1 | □ 1 ~
☯ 4 | □ 2 ~
☯ 0 | □ 0 ~
✉✉ ++ | ? ᚋ | + $ᚋ 1 ~
☯ 4 | ++ 3 ~
☯ 10 | ++ 9 ~
☯ 2 | ++ 1 ~
☯ 3 | ++ 2 ~
☯ 1 | ++ 0 ~
# MATH use equality for truth values
# Not quite committing to a *type* for truth values in the message, side-stepping that issue until we really need to decide it.
✉✉ ☺ | ☯ 0 0 ~
✉✉ ☹ | ☯ 0 1 ~
☯ $☺ (☯ 2 2) ~
☯ $☺ (> 4 2) ~
☯ $☺ (☯ 1 1) ~
☯ $☺ (> 6 4) ~
☯ $☺ (< 3 4) ~
☯ (☯ 5 5) $☺ ~
☯ (☯ 3 3) $☺ ~
☯ (☯ 4 4) $☺ ~
☯ (☯ 3 3) $☺ ~
☯ (☯ 0 0) $☺ ~
☯ $☹ (< 6 2) ~
☯ $☹ (< 4 2) ~
☯ $☹ (< 4 1) ~
☯ $☹ (> 0 0) ~
☯ $☹ (> 0 5) ~
☯ (☯ 3 2) $☹ ~
☯ (> 2 3) $☹ ~
☯ (> 4 5) $☹ ~
☯ (> 2 6) $☹ ~
☯ (> 1 6) $☹ ~
☯ $☺ $☺ ~
☯ $☹ $☹ ~
♻ | ☯ $☺ $☹ ~
♻ | ☯ $☹ $☺ ~
☯ (> 4 2) (< 1 4) ~
☯ (☯ 3 3) (< 3 5) ~
☯ (☯ 0 0) (☯ 4 4) ~
☯ (> 6 4) (< 3 5) ~
☯ (< 5 6) (< 0 2) ~
☯ (☯ 5 1) (> 2 4) ~
☯ (> 4 6) (> 1 3) ~
☯ (> 2 5) (☯ 5 3) ~
☯ (< 2 1) (< 6 4) ~
☯ (< 6 2) (> 4 5) ~
♻ | ☯ (> 0 1) (☯ 0 0) ~
♻ | ☯ (< 6 4) (☯ 5 5) ~
♻ | ☯ (☯ 4 2) (> 1 0) ~
♻ | ☯ (> 5 6) (< 1 3) ~
♻ | ☯ (> 3 6) (> 5 4) ~
♻ | ☯ (☯ 2 2) (> 0 3) ~
♻ | ☯ (> 5 2) (☯ 2 3) ~
♻ | ☯ (> 4 1) (< 2 0) ~
♻ | ☯ (☯ 2 2) (< 3 2) ~
♻ | ☯ (< 0 1) (> 3 4) ~
# MATH show mechanisms for branching
☰ ☺☹ ~
☯ 28 | ☺☹ (< 3 0) 24 28 ~
☯ 27 | ☺☹ (> 2 4) 29 27 ~
☯ 29 | ☺☹ (☯ 3 1) 20 29 ~
☯ 21 | ☺☹ (☯ 0 0) 21 26 ~
☯ 29 | ☺☹ (> 5 3) 29 23 ~
☯ 26 | ☺☹ (> 1 0) 26 22 ~
☯ 21 | ☺☹ (☯ 3 3) 21 27 ~
☯ 23 | ☺☹ (> 4 4) 25 23 ~
✉✉ >> | ? ᚋ | ? ᚌ | ☺☹ (> $ᚋ $ᚌ) $ᚋ $ᚌ ~
✉✉ << | ? ᚋ | ? ᚌ | ☺☹ (< $ᚋ $ᚌ) $ᚋ $ᚌ ~
☯ 0 | >> 0 0 ~
☯ 0 | << 0 0 ~
☯ 1 | >> 0 1 ~
☯ 0 | << 0 1 ~
☯ 2 | >> 0 2 ~
☯ 0 | << 0 2 ~
☯ 1 | >> 1 0 ~
☯ 0 | << 1 0 ~
☯ 1 | >> 1 1 ~
☯ 1 | << 1 1 ~
☯ 2 | >> 1 2 ~
☯ 1 | << 1 2 ~
☯ 2 | >> 2 0 ~
☯ 0 | << 2 0 ~
☯ 2 | >> 2 1 ~
☯ 1 | << 2 1 ~
☯ 2 | >> 2 2 ~
☯ 2 | << 2 2 ~
# 'if' does not evaluate branch-not-taken, TODO show this.
✉✉ *< | ? ᚋ | ☺☹ (< $ᚋ 1) 1 | * $ᚋ | *< | - $ᚋ 1 ~
☯ 1 | *< 1 ~
☯ 2 | *< 2 ~
☯ 6 | *< 3 ~
☯ 24 | *< 4 ~
☯ 120 | *< 5 ~
# MATH introduce the AND logical operator
☰ ☺* ~
✉✉ ☺* | ? ᚋ | ? ᚌ | ☺☹ $ᚋ $ᚌ $☹ ~
♻ | ☺* $☹ $☹ ~
♻ | ☺* $☹ $☺ ~
♻ | ☺* $☺ $☹ ~
☺* $☺ $☺ ~
☯ $☹ | ☺* $☹ $☹ ~
☯ $☹ | ☺* $☹ $☺ ~
☯ $☹ | ☺* $☺ $☹ ~
☯ $☺ | ☺* $☺ $☺ ~
☺* (☯ 2 2) (> 4 2) ~
☺* (☯ 1 1) (> 6 4) ~
☺* (< 3 4) (☯ 5 5) ~
☺* (☯ 3 3) (☯ 4 4) ~
☺* (☯ 3 3) (☯ 0 0) ~
☺* (< 5 7) (> 5 3) ~
☺* (> 5 4) (> 1 0) ~
☺* (> 3 0) (☯ 3 3) ~
☺* (< 3 4) (< 3 6) ~
☺* (> 5 4) (> 5 4) ~
♻ | ☺* (> 6 4) (< 3 1) ~
♻ | ☺* (> 3 1) (> 3 3) ~
♻ | ☺* (☯ 0 0) (☯ 5 4) ~
♻ | ☺* (< 2 4) (> 4 6) ~
♻ | ☺* (☯ 3 3) (☯ 3 1) ~
♻ | ☺* (> 1 5) (< 3 6) ~
♻ | ☺* (< 6 2) (☯ 2 2) ~
♻ | ☺* (> 2 5) (☯ 5 5) ~
♻ | ☺* (< 6 2) (☯ 3 3) ~
♻ | ☺* (< 4 3) (> 5 2) ~
♻ | ☺* (< 5 4) (☯ 1 2) ~
♻ | ☺* (< 6 4) (☯ 5 1) ~
♻ | ☺* (> 2 6) (☯ 1 5) ~
♻ | ☺* (< 6 3) (☯ 2 3) ~
♻ | ☺* (< 6 4) (> 0 1) ~
♻ | ☺* (☯ 3 5) (< 4 1) ~
♻ | ☺* (☯ 4 1) (< 4 2) ~
♻ | ☺* (< 6 3) (☯ 3 0) ~
♻ | ☺* (< 4 2) (< 4 6) ~
♻ | ☺* (> 4 1) (< 5 2) ~
♻ | ☺* (> 0 1) (> 7 5) ~
♻ | ☺* (< 3 4) (> 3 6) ~
♻ | ☺* (> 1 2) (> 6 4) ~
♻ | ☺* (< 0 1) (☯ 4 5) ~
☺* (< 4 6) (< 5 7) ~
# MATH introduce the OR logical operator
☰ ☺+ ~
✉✉ ☺+ | ? ᚋ | ? ᚌ | ☺☹ $ᚋ $☺ $ᚌ ~
♻ | ☺+ $☹ $☹ ~
☺+ $☹ $☺ ~
☺+ $☺ $☹ ~
☺+ $☺ $☺ ~
☯ $☹ | ☺+ $☹ $☹ ~
☯ $☺ | ☺+ $☹ $☺ ~
☯ $☺ | ☺+ $☺ $☹ ~
☯ $☺ | ☺+ $☺ $☺ ~
☺+ (☯ 2 2) (> 4 2) ~
☺+ (☯ 1 1) (> 6 4) ~
☺+ (< 3 4) (☯ 5 5) ~
☺+ (☯ 3 3) (☯ 4 4) ~
☺+ (☯ 3 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 ~
>☯ 2 0 ~
♻ | <☯ 2 0 ~
>☯ 2 1 ~
♻ | <☯ 2 1 ~
>☯ 2 2 ~
<☯ 2 2 ~
# MATH illustrate pairs
✉✉ ♋ | ? ᚋ | ? ᚌ | ? ᚍ | ᚍ $ᚋ $ᚌ ~
✉✉ ♋∈ | ? ♋ᚍ | ♋ᚍ | ? ᚋ | ? ᚌ $ᚋ ~
✉✉ ♋∋ | ? ♋ᚍ | ♋ᚍ | ? ᚋ | ? ᚌ $ᚌ ~
✉ ᚋ (♋ 0 4) | ☯ 0 | ♋∈ $ᚋ ~
✉ ᚋ (♋ 0 4) | ☯ 4 | ♋∋ $ᚋ ~
✉ ᚋ (♋ 6 2) | ☯ 6 | ♋∈ $ᚋ ~
✉ ᚋ (♋ 6 2) | ☯ 2 | ♋∋ $ᚋ ~
✉ ᚋ (♋ 3 9) | ☯ 3 | ♋∈ $ᚋ ~
✉ ᚋ (♋ 3 9) | ☯ 9 | ♋∋ $ᚋ ~
✉ ᚋ (♋ 7 | ♋ 10 2) | ☯ 7 | ♋∈ $ᚋ ~
✉ ᚋ (♋ 7 | ♋ 10 2) | ☯ 10 | ♋∈ | ♋∋ $ᚋ ~
✉ ᚋ (♋ 7 | ♋ 10 2) | ☯ 2 | ♋∋ | ♋∋ $ᚋ ~
✉ ᚋ (♋ 1 | ♋ 15 17) | ☯ 1 | ♋∈ $ᚋ ~
✉ ᚋ (♋ 1 | ♋ 15 17) | ☯ 15 | ♋∈ | ♋∋ $ᚋ ~
✉ ᚋ (♋ 1 | ♋ 15 17) | ☯ 17 | ♋∋ | ♋∋ $ᚋ ~
✉ ᚋ (♋ 8 | ♋ 14 9) | ☯ 8 | ♋∈ $ᚋ ~
✉ ᚋ (♋ 8 | ♋ 14 9) | ☯ 14 | ♋∈ | ♋∋ $ᚋ ~
✉ ᚋ (♋ 8 | ♋ 14 9) | ☯ 9 | ♋∋ | ♋∋ $ᚋ ~
✉ ᚋ (♋ 3 | ♋ 0 | ♋ 2 | ♋ 4 1) | ☯ 3 | ♋∈ $ᚋ ~
✉ ᚋ (♋ 3 | ♋ 0 | ♋ 2 | ♋ 4 1) | ☯ 0 | ♋∈ | ♋∋ $ᚋ ~
✉ ᚋ (♋ 3 | ♋ 0 | ♋ 2 | ♋ 4 1) | ☯ 2 | ♋∈ | ♋∋ | ♋∋ $ᚋ ~
✉ ᚋ (♋ 3 | ♋ 0 | ♋ 2 | ♋ 4 1) | ☯ 4 | ♋∈ | ♋∋ | ♋∋ | ♋∋ $ᚋ ~
✉ ᚋ (♋ 3 | ♋ 0 | ♋ 2 | ♋ 4 1) | ☯ 1 | ♋∋ | ♋∋ | ♋∋ | ♋∋ $ᚋ ~
# MATH introduce mutable objects, and side-effects
☰ ☆ ~
☰ ☆✉ ~
☰ ☆∢ ~
✉✉ ☄☆ᚋ | ☆ 14 ~
☯ (☆∢ $☄☆ᚋ) 14 ~
☆✉ $☄☆ᚋ 15 ~
☯ (☆∢ $☄☆ᚋ) 15 ~
☆✉ $☄☆ᚋ 5 ~
☆✉ $☄☆ᚋ 7 ~
☯ (☆∢ $☄☆ᚋ) 7 ~
✉✉ ☄☆ᚌ | ☆ 11 ~
☯ (☆∢ $☄☆ᚌ) 11 ~
☆✉ $☄☆ᚌ 22 ~
☯ (☆∢ $☄☆ᚌ) 22 ~
☯ (☆∢ $☄☆ᚋ) 7 ~
☯ 29 (+ (☆∢ $☄☆ᚋ) | ☆∢ $☄☆ᚌ) ~
☺☹ (☯ (☆∢ $☄☆ᚋ) 7) (☆✉ $☄☆ᚋ 88) (☆✉ $☄☆ᚋ 99) ~
☯ (☆∢ $☄☆ᚋ) 88 ~
☺☹ (☯ (☆∢ $☄☆ᚋ) 7) (☆✉ $☄☆ᚋ 88) (☆✉ $☄☆ᚋ 99) ~
☯ (☆∢ $☄☆ᚋ) 99 ~
...