Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Empty alg #6

Open
lgarron opened this issue Jul 12, 2018 · 1 comment
Open

Empty alg #6

lgarron opened this issue Jul 12, 2018 · 1 comment

Comments

@lgarron
Copy link
Member

lgarron commented Jul 12, 2018

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
Copy link
Member Author

lgarron commented Jul 12, 2018

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
)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant