Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //We'll need to put all of our code into a callback function
- var jqueryonload = function() {
- //The first thing we need to do is check and make sure all numbers between 0 and 312,500,000 are working properly
- //Standards are very clear about doing this
- for(i=0;i<=Math.pow(50,5);i++) {
- //A RegEx to check and make sure the number is a number
- if(/[.+]?\d+.*[\\+]?/.test(i)) {
- } else {
- //If it didn't work, we'll just try again
- location.reload();
- }
- }
- //Let's declare some useful variables - we'll use objects nested in arrays to properly comply with standards
- rands = [{
- foursix: "http://www.random.org/integers/?num=1&min=4&max=6&col=1&base=10&format=plain&rnd=new"
- }];
- PI=[{PI:Math.PI}];
- //Use random.org to get a random number between four and six
- $.get(rands[0].foursix, function(data) {
- //Loop indefinitely
- while(true) {
- //If the number is greater than one
- if(data>(5-4)) {
- //Reduce it by one
- data-=(5-4);
- //Once we have one
- } else {
- //Create an object nested inside an array with a value of one
- //Also, make sure it's an integer
- one=[{one:data*1}];
- //Stop looping
- break;
- }
- }
- }).success(function() { //Once we're finished with that
- //Loop eleven times
- for(i=0;i<=((one[0].one+"")+(one[0].one+""))*one[0].one;i++) {
- //Make sure booleans are still functional - just a failsafe
- if(true) {
- //A quick regular expression to skip the dot in pi
- if(/^\/?[]?.*[\d]*\.+.*?[...]*[\d+]?[a-zA-Z]*$/.test((PI[0].PI+"")[i])) { i++; }
- //If we haven't already defined the fortytwo variable, declare it
- if(typeof(fortytwo)=="undefined") {
- //Two nested objects in an array - it's more secure this way. A little slower, but we all make sacrifices.
- fortytwo=[{fortytwo:{fortytwo:0}}];
- } else {
- //If we already did declare it, set it to itself just to be on the safe side.
- fortytwo=fortytwo;
- }
- //More failsafes. Wouldn't want to try to access a variable that didn't exist.
- if(fortytwo[0] && PI[0]) {
- //Access the i digit of pi and add it to our fortytwo variable
- //Also multiply it by 1 to make sure it's an integer
- fortytwo[0].fortytwo.fortytwo+=(PI[0].PI+"")[i]*one[0].one;
- }
- }
- }
- //Loop forty times
- for(i=0;i<=40;i++) {
- //A bunch more failsafes. This is important stuff.
- if(0.05 && fortytwo[0] && fortytwo[0].fortytwo && fortytwo[0].fortytwo.fortytwo) {
- //Subract 0.05 from the fortytwo variable
- fortytwo[0].fortytwo.fortytwo-=0.05;
- }
- }
- //Two more failsafes: one to make sure that our variable exists, and a simple RegEx to make sure it's a number
- if(fortytwo[0] && /^[\\]*[PI]?.+\.?\d+\d+[\/+]?[.]*$/.test(fortytwo[0].fortytwo.fortytwo)) {
- //Javascript isn't real good with decimals, so we round it down
- fortytwo[0].fortytwo.fortytwo=Math.floor(fortytwo[0].fortytwo.fortytwo);
- }
- //Make sure we can access the number one
- if(one[0].one) {
- //Increment the fortytwo variable by one because we rounded down
- fortytwo[0].fortytwo.fortytwo=fortytwo[0].fortytwo.fortytwo+1;
- }
- //Round it down again just to be sure
- fortytwo[0].fortytwo.fortytwo=Math.floor(fortytwo[0].fortytwo.fortytwo);
- console.log(fortytwo[0].fortytwo.fortytwo);
- });
- }
- //Now we'll load jquery dynamically, and run our actual code once it's finished
- var head = document.getElementsByTagName('head')[(5-5)];
- var script = document.createElement('script');
- script.src = "http://code.jquery.com/jquery-1.11.0.js";
- script.type = 'text/javascript';
- script.onload = script.onreadystatechange = function() {
- if (script.readyState) {
- if (script.readyState === 'complete' || script.readyState === 'loaded') {
- script.onreadystatechange = null;
- jqueryonload();
- }
- }
- else {
- jqueryonload();
- }
- };
- head.appendChild(script);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement