forked from Morn91/morn91.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlab.html
90 lines (85 loc) · 3.02 KB
/
lab.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>* {font-size: 20pt; font-family: 'Lucida Console';}</style>
</head>
<body>
<script>
n=20; m=n/2*3;
x1=[0,2,3,6,7,8,10];//↓
x2=[0,4,5,6,7,9,10];//↑
y1=[1,2,4,6,8,9,10];//→
y2=[1,3,5,7,8,9,10];//←
// 0 1 2 3 4 5 6 7 8 9 10 11
symb=["║","═","╔","╗","╚","╝","╠","╣","╦","╩","╬","‎ ‎","╨","╡","?"];
function func(){
k=0;
while(k<200){
a=Math.round(Math.random()*11);
switch(i){
case 0: if(x2.indexOf(a)==-1&&func_2()) return a; break;
case n-1: if((x1.indexOf(num[i-1][j])!=-1^x2.indexOf(a)==-1)&&x1.indexOf(a)==-1&&func_2()) return a; break;
default: if((x1.indexOf(num[i-1][j])!=-1^x2.indexOf(a)==-1)&&func_2()) return a; break;
}
k++;
}
if(x1.indexOf(num[i-1][j])!=-1){return 12;}
else{if(y1.indexOf(num[i][j-1])!=-1){return 13;}else return 14;}
}
function func_2(){
switch(j){
case 0: if(y2.indexOf(a)==-1) return 1; break;
case m-1: if((y1.indexOf(num[i][j-1])!=-1^y2.indexOf(a)==-1)&&y1.indexOf(a)==-1) return 1; break;
default: if(y1.indexOf(num[i][j-1])!=-1^y2.indexOf(a)==-1) return 1; break;
return 0;
}
}
num=new Array(n);
for(i=0;i<n;i++){
num[i]=new Array(m);
for(j=0;j<m;j++){
document.write(symb[num[i][j]=func()]);
}
document.write("<br/>");
}
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-76637132-1', 'auto');
ga('send', 'pageview');
</script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript">
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter23534974 = new Ya.Metrika({
id:23534974,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true,
trackHash:true,
ecommerce:"dataLayer"
});
} catch(e) { }
});
var n = d.getElementsByTagName("script")[0],
s = d.createElement("script"),
f = function () { n.parentNode.insertBefore(s, n); };
s.type = "text/javascript";
s.async = true;
s.src = "https://mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/23534974" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
</body>
</html>