-
Notifications
You must be signed in to change notification settings - Fork 0
/
SourceCodeFake.html
64 lines (45 loc) · 1.7 KB
/
SourceCodeFake.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
<script>
min=5
max=80
extendedmax=250
maxThreshold=0.01
LOC=1200
IndentStep=2
IndentionFactor=1/3 // normal = 1/3; 0..1
</script>
<style>
#sourcecode{line-height:2px; margin:0; padding:0; font-size:0px}
</style>
</head>
<body>
<div id="sourcecode"><br>
<script>
indent=0
for (i=0; i<LOC; i++){
currentmax = max
if (Math.random() < maxThreshold) currentmax=extendedmax
// Indention:
// IndentionDirection = 0..(0.5 - IndentionFactor/2) => 0..0.33333 --> -1
// = (0.5 + IndentionFactor/2)..1 => 0.66666..1 --> 1
// = (0.5 - IndentionFactor/2)..(0.5 + IndentionFactor/2) => 0.33333..0.66666 --> 0
IndentionDirection = Math.random()
if (IndentionDirection <= 0.5 - (IndentionFactor/2)) indent -= 1
else if (IndentionDirection >= 0.5 + (IndentionFactor/2)) indent += 1
document.write("<img src=transparent.gif height=1 width=" + indent * IndentStep + "><img src=dot.gif height=1 width=" + (Math.floor(Math.random() * (currentmax-min)) + min) + "><br>")
}
while (indent>0){
currentmax = max
if (Math.random() < maxThreshold) currentmax=extendedmax
indent -= 1
document.write("<img src=transparent.gif height=1 width=" + indent * IndentStep + "><img src=dot.gif height=1 width=" + (Math.floor(Math.random() *(currentmax-min)) + min) + "><br>")
}
</script>
</div>
</body>
</html>