Skip to content

Instantly share code, notes, and snippets.

@fracz
Last active November 29, 2022 09:29
Show Gist options
  • Save fracz/d29bdcb884f3f1539da16ced66bcc705 to your computer and use it in GitHub Desktop.
Save fracz/d29bdcb884f3f1539da16ced66bcc705 to your computer and use it in GitHub Desktop.
GC helpers
'N 50° 02. [G(A x E) : (A-C) + 2(F x H) + (B - 6C) -1]'.replace(/\[/g, '(').replace(/\]/g, ')').replace(/x/g, '*').replace(/:/g, '/').replace(/(\d)([A-Z\(])/g, '$1*$2').replace(/([A-Z])([\(])/g, '$1*$2')
letterValue = (letter) => letter.toUpperCase().charCodeAt(0) - 64;
letterValues = (word) => word.split('').map(letterValue);
// [A,B,C] = letterValues('KOT');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment