ShaWn's Nerd Bait

In this example below you will see how to do a ShaWn's Nerd Bait with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by chrismbarr, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright chrismbarr ©
  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>ShaWn's Nerd Bait</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <pre id="output"></pre>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/chrismbarr/shawnandaposs-nerd-bait-GaoDl */
*{box-sizing:border-box;}
html,body{
  min-height:100%;
  height:100%;
  margin:0;
  padding:0;
  
}
#output{
  color:green;
  background:black;
  width:100%;
  min-height:100%;
  padding:10px;
  margin:0;
}
#output hr{
  border-color: green;
}

/*Downloaded from https://www.codeseek.co/chrismbarr/shawnandaposs-nerd-bait-GaoDl */
//https://bit.ly/1rlp4k3 Easter Egg!
var source=[
  "xoxoxxox",
  "xooxoxxo",
  "xooxxoxx",
  "xooxxoxx",
  "xooxooxx",
  "xooxxoxo",
  "xxoooxox",
  "xxoxxxxx",
  "xoxxoxxx",
  "xooxoooo",
  "xoooxooo",
  "xxoxxxxx",
  "xooxxoxx",
  "xooxoxxo",
  "xooxxoxx",
  "xxoxxxxx",
  "xoxxxxoo",
  "xooxxxxo",
  "xooxxoxo",
  "xoooxxoo",
  "xooxxxxo",
  "xoooxxox",
  "xxoxxxxx",
  "xooxoxoo",
  "xooxxoxo",
  "xooxxoxo",
  "xoooxxxx",
  "xxoxxxxx",
  "xooxoxxx",
  "xooxoxxo",
  "xoooxxoo",
  "xxoxxxxx",
  "xoooxxoo",
  "xooxxoxo",
  "xooxxxoo",
  "xoooxxox",
  "xooxxoxo",
  "xoooxoxx",
  "xoooxxoo",
  "xxoooooo"
];

// Left 32
var a = [41, 0, 84, 79, 76, 68, 0, 89, 79, 85, 0, 71, 85, 89, 83, 0, 41, 0, 87, 65, 83, 0, 71, 79, 73, 78, 71, 0, 84, 79, 0, 82, 69, 70, 65, 67, 84, 79, 82, 0, 84, 72, 69, 0, 53, 83, 69, 82, 83, 0, 44, 73, 83, 84, 1, 0, 13, 0, 51, 72, 65, 55, 78];
 

// http://www.infinitelooper.com/?v=gIdLRftdrH8#/186;191
var b = [141, 153, 153, 149, 95, 84, 84, 135, 142, 153, 83, 145, 158, 84, 121, 112, 109, 89, 94, 87]; // Kitty >^..^<

// Et tu, Brute?
// var char = even or odd (This line est mort. Vive this line!)
var c = [64, 8, 96, 1, 96, 9, 96, 11, 112, 5, 48, 10, 0, 10, 64, 7, 96, 15, 96, 15, 96, 4, 96, 2, 112, 9, 96, 5, 32, 12, 32, 0, 64, 1, 112, 0, 112, 0, 80, 2, 96, 9, 112, 6, 96, 5, 112, 2, 32, 14, 0, 10, 64, 9, 32, 7, 96, 12, 96, 12, 32, 0, 96, 13, 96, 9, 112, 3, 112, 3, 32, 0, 112, 9, 96, 15, 112, 5, 32, 0, 96, 7, 112, 5, 112, 9, 112, 3, 32, 0, 96, 1, 32, 0, 112, 7, 96, 8, 96, 15, 96, 12, 96, 5, 32, 0, 96, 2, 112, 5, 96, 14, 96, 3, 96, 8, 32, 1, 0, 10, 80, 2, 96, 5, 96, 6, 112, 2, 96, 9, 96, 7, 96, 5, 112, 2, 96, 1, 112, 4, 96, 15, 112, 2, 32, 14];



//=============================================================


var o = document.getElementById("output");

//Binary - SOLVED!
//Riddle answer: http://en.wikipedia.org/wiki/Caesar_cipher
var rChars='';
for (var i = 0; i < source.length; i++) {
  var binaryString = source[i].replace(/x/g,0).replace(/o/g,1);
  var charCode = parseInt(binaryString,2);
  rChars+=String.fromCharCode(charCode);
}
o.innerHTML+=rChars+"<hr/>";

//A - SOLVED!
var aChars='';
for (var i = 0; i < a.length; i++) {
 aChars+=String.fromCharCode(a[i]+32);
}
o.innerHTML+=aChars+"<hr/>";

//B - SOLVED!
var bChars='';
for (var ii = 0; ii < b.length; ii++) {
 bChars+=String.fromCharCode(b[ii]-37);
}
o.innerHTML+=bChars+"<hr/>";

//C - SOLVED!
var cChars='';
for (var iii = 0; iii < c.length; iii++) {
  if(iii %2 === 0){
    cChars+=String.fromCharCode(c[iii] + c[iii  + 1]);
  }
}
o.innerHTML+=cChars+"<hr/>";

Comments