Skip to content

Commit

Permalink
added N-perm and a new parity pattern that uses it
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioDiMonte committed May 2, 2015
1 parent 0cc8688 commit 143650a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/static/RubikUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ var RubikUtils = (function(){

/* -- parity -- */
p_PTJ: " (L'U2) LU (L'U2) (RU') L (RU')i ",
p_PTN: " ((L'UR') U2 (L'UR')')2 U ",
p_PAR: " (U'F2) [PTJ] (U'F2)i ",
p_PRN: " (F2y) [PTN] (F2y)i",

/* ################### EDGES PERMUTATIONS ################### */

Expand Down Expand Up @@ -245,7 +247,7 @@ var RubikUtils = (function(){
* @param m {String} the pattern to search for
* @returns {Boolean} true if the oriented piece is a property of RubikHelper.patterns
*/
pattern : function(m) { return (/^(o2[udfb]|o4e|o6[lr]|c[cw][23]|ptj|par)$/i).test(m); },
pattern : function(m) { return (/^(o2[udfb]|o4e|o6[lr]|c[cw][23]|ptj|ptn|par|prn)$/i).test(m); },

/**
* Returns TRUE if the given string is actually a cube's piece (edge or corner)
Expand Down Expand Up @@ -884,7 +886,7 @@ var RubikUtils = (function(){
* @returns {String}
*/
all: function(seq) {
return seq.replace(/[^udfblrmesxyz2-9i'\-\+\(\)\[\]_oecwptja]+/ig,'');
return seq.replace(/[^udfblrmesxyz2-9i'\-\+\(\)\[\]_oecwptjna]+/ig,'');
},

/**
Expand All @@ -898,7 +900,7 @@ var RubikUtils = (function(){
pieces: function(seq) {
seq = seq.replace(/[i']+/ig,'-');
seq = seq.replace(/[,;\.\n\r ]+/g,',');
seq = seq.replace(/[^udfblrmesxyz2\-\+,_oecwptja346]+/ig,'');
seq = seq.replace(/[^udfblrmesxyz2\-\+,_oecwptjna346]+/ig,'');

return seq;
},
Expand Down

1 comment on commit 143650a

@FabioDiMonte
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as requested in issue #3

Please sign in to comment.