Debian Codegraph @

tests/1411.dot

raw
1 digraph G {
2 "/*
3 This mess is the project of *manually* .Dot-ify minor .JavaScript projects
4 Current state: creating nodes, none connection done for the moment
5 May contain lots of stupid english-speaking mistakes
6 */"
7
8 "var VERSION=2.0106;"
9 "var BETA=0;"
10
11 "/*=====================================================================================
12 MISC HELPER FUNCTIONS
13 =======================================================================================*/"
14 "function l(what) {return document.getElementById(what);}"
15 "function choose(arr) {return arr[Math.floor(Math.random()*arr.length)];}"
16
17 "function escapeRegExp(str){return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");}"
18 "function replaceAll(find,replace,str){return str.replace(new RegExp(escapeRegExp(find),'g'),replace);}"
19
20 "//disable sounds (sorry)"
21 "var realAudio=Audio;//backup real audio"
22 "Audio=function(src){
23 if (src && src.indexOf('soundjay')&gt-1) {Game.Popup('Sorry, no sounds');this.play=function(){};}
24 else return new realAudio(src);
25 };"
26
27 "if(!Array.prototype.indexOf) {
28 Array.prototype.indexOf = function(needle) {
29 for(var i = 0; i < this.length; i++) {
30 if(this[i] === needle) {return i;}
31 }
32 return -1;
33 };
34 }"
35
36 "function randomFloor(x) {if ((x%1)<Math.random()) return Math.floor(x); else return Math.ceil(x);}"
37
38 "function shuffle(array)
39 {
40 var counter = array.length, temp, index;
41 // While there are elements in the array
42 while (counter--)
43 {
44 // Pick a random index
45 index = (Math.random() * counter) | 0;
46
47 // And swap the last element with it
48 temp = array[counter];
49 array[counter] = array[index];
50 array[index] = temp;
51 }
52 return array;
53 }"
54
55 "var sinArray=[];"
56 "for (var i=0;i<360;i++)
57 {
58 //let's make a lookup table
59 sinArray[i]=Math.sin(i/360*Math.PI*2);
60 }"
61 "function quickSin(x)
62 {
63 //oh man this isn't all that fast actually
64 //why do I do this. why
65 var sign=x<0?-1:1;
66 return sinArray[Math.round(
67 (Math.abs(x)*360/Math.PI/2)%360
68 )]*sign;
69 }"
70
71 "/*function ajax(url,callback){
72 var ajaxRequest;
73 try{ajaxRequest = new XMLHttpRequest();} catch (e){try{ajaxRequest=new ActiveXObject('Msxml2.XMLHTTP');} catch (e) {try{ajaxRequest=new ActiveXObject('Microsoft.XMLHTTP');} catch (e){alert("Something broke!");return false;}}}
74 if (callback){ajaxRequest.onreadystatechange=function(){if(ajaxRequest.readyState==4){callback(ajaxRequest.responseText);}}}
75 ajaxRequest.open('GET',url+'&nocache='+(new Date().getTime()),true);ajaxRequest.send(null);
76 }*/"
77
78 # var ajax=function(url,callback)
79 //[lots of unfinished things who have been turned into comments using #]
80 # /*=======
81 }