alg.js
alg.js copied to clipboard
Empty alg
The following throws A sequence cannot be empty.:
var s = alg.parse("L L'")
alg.coalesceBaseMoves(s)
I'm currently leaning towards a special, non-nestable EmptyAlgorithm extends Algorithm class to represent the empty alg, if anything.
I'm currently leaning towards a special, non-nestable EmptyAlgorithm extends Algorithm class to represent the empty alg.
I'm doing this to avoid a bunch of edge cases that a normal cuber would never encounter by hand. For example, the following isn't really useful except for programmatically constructed edge cases:
new Alg.Conjugate(
new Alg.EmptySequence(),
new Alg.BlockMove("R", 1),
1
)