alg.js icon indicating copy to clipboard operation
alg.js copied to clipboard

Empty alg

Open lgarron opened this issue 7 years ago • 1 comments

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.

lgarron avatar Jul 12 '18 03:07 lgarron

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
)

lgarron avatar Jul 12 '18 03:07 lgarron