Menu

formatAlgorithm Function

Frank Vanhoof

formatAlgorithm() Function

The formatAlgorithm is a function that adds the HTML markup to the various
parts of the algorithm to emphasize primes and double moves. This function
also requires each of the styles marked in the HTML as classes
and are defined in the CSS as class selectors.

  • prime
  • supscript
  • rotation

formatAlgorithm(algorithm)

Parameters

algorithm
A string containing the algorithm. Make sure single quotes are
escaped.

Example:

  1. In CSS create a selector and rule for the class.
    .prime { color:red; }

In the JavaScript call the formatAlgorithm function to get a string containing CSS formatted HTML.

    document.getElementById("ePermAlg").innerHTML=pageCube.formatAlgorithm("R2UR\'y(U\'R\'U)3 Y\'RU\'R2");

Related

Wiki: cubeScribe Wiki

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.