Skip to content

Instantly share code, notes, and snippets.

65 char

n = arguments[0]
s = n*n*++n*n/4


  while(k=--n*n*n)
	s -= k*k
  
 
function arr_encryption(msg) {
  var message = msg.split(' ').join('.'),
      output = '';
      
  // add . if needed
  for (k=0;k<message.length % 6;k++) {
    message += '.';
  }
 
function blackOrWhite(s) { // true: black, false: white
  var vertical = s[0].charCodeAt(0) - 'a'.charCodeAt(0) + 1;
  var horizon = s[1];
  if (vertical % 2 == 1) { // vertical odd
    if (horizon % 2 == 0) { // horizon even
      return false;
    }
    return true;
  } else { // vertical even