Skip to content

Instantly share code, notes, and snippets.

@fazlurr
Created June 22, 2014 12:03
Show Gist options
  • Select an option

  • Save fazlurr/f376f515432dc5b7248c to your computer and use it in GitHub Desktop.

Select an option

Save fazlurr/f376f515432dc5b7248c to your computer and use it in GitHub Desktop.
function opposite(c) {
var result='';
var ch='';
var list1='0123456789ABCDEF';
var list2='FEDCBA9876543210';
for (var i=0; i<c.length; i++) {
ch=c.charAt(i);
for (var n=0; n<list1.length; n++) {
if(ch==list1.charAt(n)) result += list2.charAt(n);
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment