-
Notifications
You must be signed in to change notification settings - Fork 0
/
schemer.html
7579 lines (7244 loc) · 212 KB
/
schemer.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html itemscope='' itemtype='http://schema.org/SearchResultsPage' lang='ru' >
<head >
<meta content='text/html; charset=windows-1251' http-equiv='Content-Type' />
<meta content='ru-RU' http-equiv='Content-Language' />
<meta content='design,electric,circuit,дизайн,электро,схем' name='keywords' />
<meta content='Static' name='googlebot' />
<meta content='NoIndex,NoArchive' name='Robots' />
<meta content='http://github.com/Alikberov' name='Author' />
<meta description='textual electric circuits visualisator;рисование текстовых схем' />
<--meta http-equiv=refresh content='3'>
<title>Schemer - Electric circuits viewer</title>
<style>
a {
border :none;
text-decoration :underline;
}
a:hover {
border :thick gray outset;
text-decoration :none;
}
a[href^='?'] {
background-color:buttonface;
border :thin buttonface outset;
color :red;
text-decoration :none;
}
a[href^='?']:active {
border :thin buttonface inset;
}
a[href^='?']:hover {
border :thin buttonface solid;
}
body {
margin :0px 0px 0px 0px;
padding :0px 0px 0px 0px;
}
canvas,plaintext,pre,div {
display :none;
}
div {
white-space :pre-wrap;
}
img {
vertical-align :top;
}
select {
display :none;
width :100%;
}
p {
display :none;
text-align :center;
}
textarea {
background-color:lavender;
border :none;
color :green;
display :none;
font-family :'Courier New';
font-weight :bold;
margin :0px 0px 0px 0px;
padding :0px 0px 0px 0px;
}
</style>
<script>
/*
?0? |0|
?.!.? -+-+-
3-+.1 3|.|1
?...? -+-+-
?2? |2|
00 01 02 3 04 05 06
10 11 12 3 14 15 16
20 21 22 3 24 25 26
11,06,16,04,05,24,14,26,25,02,12,00,01,20,10,22,21
080:000
1_0:0_0
000:000
*/
/*
080:000
1_0:0_0
000:000
*/
var
Schemer = function(dictionary) {
this.Parts = new Object(); // Circuit parts properties
this.Parts.image = new Image(); // Circuit parts image
this.Parts.width = 0; // Circuit parts width
this.Parts.height = 0; // Circuit parts height
this.Parts.Brush = new Object(); // Circuit parts palette
this.Parts.Brush["Z"] = 0xF000F070; // Circuit part zip-text color
this.Parts.Brush["X"] = 0xF000F000; // Circuit part xeroxing color
this.Parts.Brush["O"] = 0xF000F77F; // Circuit part outline color
this.Parts.Brush[","] = 0xFFFFFDDD; // Circuit part common color
this.Parts.Brush["."] = 0xFFFFFFFF; // Circuit part blank color
var canvas = document.createElement("canvas");
var context = canvas.getContext("2d");
var elements = dictionary.split(/^$/);
var element, index, part, symbols, symbol, string;
while(elements.length) {
element = elements.shift().match(/^.+$/gm);
var markers = new Array();
var vectors = new Array();
var pattern = new Array([],[],[],[]);
var i = 0;
while(element.length) {
symbols = element.shift().split(/\t+/);
markers.push(symbols.shift());
vectors.push(symbols.shift());
if(i < 3)
pattern[i] = pattern[i].concat(symbols);
i = (i + 1) & 3;
}
while(pattern[0].length) {
string = pattern[0].shift() + pattern[1].shift() + pattern[2].shift();
pattern[3].push(string.replace(/([()\[\]\\\^\$\|\?\+\*])/g, "\\$1"));
}
//alert(pattern[3].join("\r"));
}
return this;
};
var
letters = {
width :0, // Width of all symbols
height :0, // Height of all symbols
palette :{ // Palette of all symbols
"." :[0xFFFFFFFF, 0xFFFFFFFF],
"," :[0xFFDFDFDF, 0xFFFFFFFF],
"O" :[0xFF7777FF, 0xFF000000],
"X" :[0xFF000000, 0xFF000000],
"Z" :[0xFF007F00, 0xFF000000],
"L" :[0xFF000000, 0xFF000000],
"J" :[0xFF000000, 0xFF000000]
},
chips :{
"7400" :"' / / / / / / GND / / / / / / /VCC ЛА3",
"7401" :"' / / / / / / GND / / / / / / /VCC ЛА8",
"7402" :"' / / / / / / GND / / / / / / /VCC ЛЕ1",
"7403" :"' / / / / / / GND / / / / / / /VCC ЛА9",
"7404" :"' / / / / / / GND / / / / / / /VCC ЛН1",
"7405" :"' / / / / / / GND / / / / / / /VCC ЛН2",
"7406" :"' / / / / / / GND / / / / / / /VCC ЛН3",
"7407" :"' / / / / / / GND / / / / / / /VCC ЛН4",
"7408" :"' / / / / / / GND / / / / / / /VCC ЛИ1",
"7410" :"' / / / / / / GND / / / / / / /VCC ЛА4",
"7411" :"' / / / / / / GND / / / / / / /VCC ЛИ3",
"7412" :"' / / / / / / GND / / / / / / /VCC ЛА10",
"7413" :"' / / / / / / GND / / / / / / /VCC ТЛ1",
"7414" :"' / / / / / / GND / / / / / / /VCC ТЛ2",
"7415" :"' / / / / / / GND / / / / / / /VCC ЛИ4",
"7416" :"' / / / / / / GND / / / / / / /VCC ЛН5",
"7417" :"' / / / / / / GND / / / / / / /VCC ЛП4",
"7420" :"' / / / / / / GND / / / / / / /VCC ЛА1",
"7421" :"' / / / / / / GND / / / / / / /VCC ЛИ6",
"7422" :"' / / / / / / GND / / / / / / /VCC ЛА7",
"7423" :"' / / / / / / GND / / / / / / /VCC ЛЕ2",
"7425" :"' / / / / / / GND / / / / / / /VCC ЛЕ3",
"7426" :"' / / / / / / GND / / / / / / /VCC ЛА11",
"7427" :"' / / / / / / GND / / / / / / /VCC ЛЕ4",
"7428" :"' / / / / / / GND / / / / / / /VCC ЛЕ5",
"7430" :"' / / / / / / GND / / / / / / /VCC ЛА2",
"7432" :"' / / / / / / GND / / / / / / /VCC ЛЛ1",
"7437" :"' / / / / / / GND / / / / / / /VCC ЛА12",
"7438" :"' / / / / / / GND / / / / / / /VCC ЛА13",
"7440" :"' / / / / / / GND / / / / / / /VCC ЛА6",
"7442" :"DC Y0 Y1 Y2 Y3 Y4 Y5 Y6 GND Y7 Y8 Y9 /A3 /A2 /A1 /A0 /VCC ИД6",
"7450" :"' / / / / / / GND / / / / / / /VCC ЛР1",
"7451" :"' / / / / / / GND / / / / / / /VCC ЛР11",
"7453" :"' / / / / / / GND / / / / / / /VCC ЛР3",
"7454" :"' / / / / / / GND / / / / / / /VCC ЛР13",
"7455" :"' / / / / / / GND / / / / / / /VCC ЛР4",
"7460" :"' / / / / / / GND / / / / / / /VCC ЛД1",
"7464" :"' / / / / / / GND / / / / / / /VCC ЛР9",
"7465" :"' / / / / / / GND / / / / / / /VCC ЛР10",
"7472" :"TT . S /J1 /J2 /J3 . GND . /K1 /K2 /K3 C R /VCC ТВ1",
"7474" :"T R /D /C S . . GND . . S /C /D R /VCC ТМ2",
"7775" :"T . /D1 /D2 /EI /VCC /D3 /D4 . . . . . /EI . . . ТМ7",
"7477" :"T . /D1 /D2 /EI /VCC /D3 /D4 . . . . /EI . . ТМ5",
"7480" :"SM /B* /B// /Cn Cn /S S GND /A0 /A1 /A* /A** /B0 /B1 /VCC ИМ1",
"7481" :"RAM /A3 /A2 /A1 /VCC /B1 /B2 /B3 /B4 /W0 GND /R0 /R1 /W1 /A4 РУ1",
"7482" :"SM /S0 /A0 /B0 /VCC Cn . . . . . GND /S1 /B1 /A1 ИМ2",
"7483" :"SM /A3 /S3 /A2 /B2 GND /S1 /B1 /A1 /S0 /A0 /B0 /VCC /Cn /Cn+1 /S3 /B3 ИМ3",
"7485" :"CARRY B3 /IA<B /IA=B /IA>B /A>B /A=B /A<B GND /B0 /A0 /B1 /A1 /A2 /B2 /A3 /VCC СП1",
"7486" :"' / / / / / / GND / / / / / / /VCC ЛП5",
"7490" :"CT2/10 C1 /S1 /S2 . /VCC /R1 /R2 /Q2 /Q1 GND /Q3 /Q0 . C0 ИЕ2",
"7492" :"CT2/6 C1 . . . /VCC /R1 /R2 /Q3 /Q2 GND /Q1 /Q0 . C0 ИЕ4",
"7493" :"CT2 C1 /R1 /R2 . /VCC . . /Q2 /Q1 GND /Q3 /Q0 . C0 ИЕ5",
"7495" :"RG /S1 /D0 /D1 /D2 /D3 /PE GND C2 C1 /Q3 /Q2 /Q1 /Q0 /VCC ИР1",
"74107" :"TT /J1 . . /K1 . . GND /J2 C2 R2 /K2 C1 K1 VCC ТВ6",
"74109" :"TT R1 /J1 K1 /C1 S1 /Q1 Q1 GND Q2 /Q2 S2 /C2 K2 /J2 R2 /VCC ТВ15",
"74112" :"TT C1 /K1 /J1 S1 /Q1 Q1 GND /Q2 S2 /J2 /K2 C2 R2 R1 /VCC ТВ9",
"74113" :"TT C1 /K1 /J1 S1 /Q1 Q1 GND Q2 /Q2 S2 /J2 /K2 C2 /VCC ТВ10",
"74114" :"TT R /K1 /J1 S1 /Q1 Q1 GND Q2 /Q2 S2 /J2 /K2 C /VCC ТВ11",
"74121" :"G1 Q . A1 A2 /B /A GND . Bex /C /R . . /VCC АГ1",
"74123" :"G1 A1 /B1 /R1 Q1 /Q2 /C2 /RC2 GND A2 /B2 /R2 Q2 /Q1 /C1 /RC1 АГ3",
"74124" :"GG /U1 /U2 /D2 /Ca2 /Cb2 EI2 /Q2 GND2 GND /Q1 EI1 /Cb1 /Ca1 /D1 /VCC2 /VCC ГГ1",
"74125" :"1 EIO1 /I1 Y1 EIO2 /I2 Y2 GND Y3 /I3 EIO3 Y4 /I4 EIO4 /VCC ЛП8",
"74128" :"' / / / / / / GND / / / / / / /VCC ЛЕ6",
"74132" :"' / / / / / / GND / / / / / / /VCC ТЛ3",
"74134" :"' / / / / / / GND / / / / / / /VCC ЛА19",
"74136" :"' / / / / / / GND / / / / / / /VCC ЛЛ3",
"74138" :"DC /A0 /A1 /A2 E1 E2 /E3 Y7 GND Y6 Y5 Y4 Y3 Y2 Y1 Y0 /VCC ИД7",
"74139" :"DC Ea /A0a /A1a Y0a Y1a Y2a Y3a GND Y3b Y2b Y1b Y0b /A1b /A0b /VCC ИД14",
"74140" :"' / / / / / / GND / / / / / / /VCC ЛА16",
"74141" :"DC Y8 Y9 A0 A3 /VCC A1 A2 Y2 Y3 Y7 Y6 GND Y4 Y5 Y1 . ИД1",
"74145" :"DC Y0 Y1 Y2 Y3 Y4 Y5 Y6 GND Y7 Y8 Y9 /A3 /A2 /A1 /A0 /VCC ИД10",
"74147" :"CD I4 I5 I6 I7 I8 A2 A1 GND A0 I9 I1 I2 I3 A3 . /VCC ИВ3",
"74148" :"CD I5 I6 I7 I8 EI A2 A1 GND A0 I1 I2 I3 I4 GS EO /VCC ИВ1",
"74150" :"MX /I8 /I7 /I6 /I5 /I4 /I3 /I2 /I1 E Y /S3 GND /S2 /S1 /S0 /I16 /I15 /I14 /I13 /I12 /I11 /I10 /I9 /VCC КП1",
"74151" :"MX /I4 /I3 /I2 /I1 /Y Y E GND /S2 /S1 /S0 /I8 /I7 /I6 /I5 /VCC КП7",
"74152" :"MX /I5 /I4 /I3 /I2 /I1 Y GND /S2 /S1 /S0 /I8 /I7 /I6 /VCC КП5",
"74153" :"MX Ea /S1 /I4a /I3a /I2a /I1a /Ya GND /Yb /I1b /I2b /I3b /I4b /S0 Eb /VCC КП2",
"74154" :"DC Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y10 GND Y11 Y12 Y13 Y14 Y15 E0 E1 /A3 /A2 /A1 /A0 /VCC ИД3",
"74155" :"DC /D2 S2 /A1 Y8 Y7 Y6 Y5 GND Y1 Y2 Y3 Y4 /A0 S1 D1 /VCC ИД4",
"74160" :"CT10 R /C /D0 /D1 /D2 /D3 /CEP GND PE /CET /Q3 /Q2 /Q1 /Q0 /TC /VCC ИЕ9",
"74161" :"CT2 R /C /D0 /D1 /D2 /D3 /CEP GND PE /CET /Q3 /Q2 /Q1 /Q0 /TC /VCC ИЕ10",
"74163" :"CT2 SR /C /D0 /D1 /D2 /D3 /CEP GND PE /CET /Q3 /Q2 /Q1 /Q0 /TC /VCC ИЕ18",
"74164" :"RG /DSa /DSb /Q0 /Q1 /Q2 /Q3 GND /C R /Q4 /Q5 /Q6 /Q7 /VCC ИР8",
"74165" :"RG PE /C /D4 /D5 /D6 /D7 /Q7 GND Q7 /SI /D0 /D1 /D2 /D3 CE /VCC ИР9",
"74168" :"CT10 U/D /C /D0 /D1 /D2 /D3 CEP GND PE CET /Q3 /Q2 /Q1 /Q0 PO /VCC ИЕ16",
"74169" :"CT2 /U/D /C /D0 /D1 /D2 /D3 CEP GND PE CET /Q3 /Q2 /Q1 /Q0 PO /VCC ИЕ17",
"74170" :"RAM /D2 /D3 /D4 Rb Ra /Q4 /Q3 GND /Q2 /Q1 RE WE /WB /WA /D1 /VCC РП1",
"74172" :"RG /Aa1 /Aa0 WEa /Da1 /Dc1 /C /Ab2 /Ab1 /Ab0 /Qb1 /Qc3 GND /Qc0 /Qb0 REb REc /Ac0 /Ac1 /Ac2 WEc /Dc0 /Da0 /Aa2 /VCC РП3",
"74173" :"RG EO1 EO2 /Q0 /Q1 /Q2 /Q3 /C GND PE1 PE2 /D3 /D2 /D1 /D0 /R /VCC ИР15",
"74174" :"RG R /Q1 /D1 /D2 /Q2 /D3 /Q3 GND /C /Q4 /D4 /Q5 /D5 /D6 /Q6 /VCC ТМ9",
"74175" :"RG R /Q1 Q1 /D1 /D2 Q2 /Q2 GND /C /Q3 Q3 /D3 /D4 Q4 /Q3 /VCC ТМ8",
"74180" :"PAR /I6 /I7 /EE /OE /SE /SO /I0 /I1 /I2 /I3 /I4 /I5 /VCC ИП2",
"74181" :"ALU B0 A0 /S3 /S2 /S1 /S0 /Cn /M F0 F1 F2 GND F3 /A=B P Cn+4 G B3 A3 B2 A2 B1 A1 /VCC ИП3",
"74182" :"ALU G2 P2 G1 P1 G4 P4 P GND /Cn+z G /Cn+y /Cn+x /Cn G3 P3 /VCC ИП4",
"74184" :"ROM /Q0 /Q1 /Q2 /Q3 /Q4 /Q5 /Q6 GND /Q7 /A0 /A1 /A2 /A3 /A4 RE /VCC ПР6",
"74185" :"ROM /Q0 /Q1 /Q2 /Q3 /Q4 /Q5 /Q6 GND /Q7 /A0 /A1 /A2 /A3 /A4 RE /VCC ПР7",
"74192" :"CT10 /D1 /Q1 /Q0 /Cd /Cu /Q2 /Q3 GND /D3 /D2 PE TCu TCd /R /D0 /VCC ИЕ6",
"74193" :"CT2 /D1 /Q1 /Q0 /Cd /Cu /Q2 /Q3 GND /D3 /D2 PE TCu TCd /R /D0 /VCC ИЕ7",
"74194" :"RG R /DSR /D0 /D1 /D2 /D3 /DSL GND /S0 /S1 /C /Q3 /Q2 /Q1 /Q0 /VCC ИР11",
"74195" :"RG R /J K /D0 /D1 /D2 /D3 GND PE C Q3 /Q3 /Q2 /Q1 /Q0 /VCC ИР12",
"74196" :"CT10 PE /Q2 /D2 /D0 /Q0 C1 GND C0 /Q1 /D1 /D3 /Q3 R /VCC ИЕ14",
"74197" :"CT2 PE /Q2 /D2 /D0 /Q0 C1 GND C0 /Q1 /D1 /D3 /Q3 R /VCC ИЕ15",
"74240" :"1 /1G /A1a /2Y4 /1A2 /2Y3 /1A3 /2Y2 /1A4 /2Y1 GND /2A1 /1Y4 /2A2 /1Y3 /2A3 /1Y2 /2A4 /1Y1 /2G /VCC АП3",
"74241" :"1 /1G /A1a /2Y4 /1A2 /2Y3 /1A3 /2Y2 /1A4 /2Y1 GND /2A1 /1Y4 /2A2 /1Y3 /2A3 /1Y2 /2A4 /1Y1 /2G /VCC АП4",
"74242" :"ИП6",
"74243" :"ИП7",
"74245" :"АП6",
"74251" :"MX /I4 /I3 /I2 /I1 /Y Y EO GND /S2 /S1 /S0 /I8 /I7 /I6 /I5 /VCC КП15",
"74253" :"MX EOa /S1 /I4a /I3a /I2a /I1a /Ya GND /Yb /I1b /I2b /I3b /I4b /S0 EOb /VCC КП12",
"74257" :"MX S /I1a /I2a /Ya /I1b /I2b /YB GND /Yc /I2c /I1c /Yd /I2d /I1d EO /VCC КП11",
"74258" :"MX S /I1a /I2a Ya /I1b /I2b Yb GND Yc /I2c /I1c Yd /I2d /I1d EO /VCC КП14",
"74260" :"' / / / / / / GND / / / / / / /VCC ЛЕ7",
"74261" :"ИП8",
"74279" :"' R1 S1a S1b /Q1 R2 S2 /Q2 GND /Q3 R3 S3b S3a /Q4 R4 S4 /VCC ТР2",
"74283" :"SM /S1 /B1 /A1 /S0 /A0 /B0 /Cn GND /Cn+1 /S3 /B3 /A3 /S2 /A2 /B2 /VCC ИМ6",
"74295" :"RG /SI /D0 /D1 /D2 /D3 PE GND /EO C /Q3 /Q2 /Q1 /Q0 /VCC ИР16",
"74298" :"MX /D1b /D1a /D0a /D0b /D1c /D1d /D0d GND /D0c /A /C /Yd /Yc /Yb /Ya /VCC КП13",
"74299" :"RG /S0 EO1 EO2 /IO6 /IO4 /IO2 /IO0 /Q0 R GND /DS0 /C /IO1 /IO3 /IO5 /IO7 /Q7 /DS7 /S1 /VCC ИР24",
"74322" :"RG /EN /S/L /Da /Ba /Bc /Be /Bg /C0 /C1 GND /CK /Qh /Bh /Bf /Bd /Bb /DN /SE /SEL /VCC ИР28",
"74323" :"RG /S0 EO1 EO2 /IO6 /IO4 /IO2 /IO0 /Q0 SR GND /DS0 /C /IO1 /IO3 /IO5 /IO7 /Q7 /DS7 /S1 /VCC ИР24+",
"74358" :"ИМ7",
"74366" :"1 EO1 /I1 Y1 /I2 Y2 /I3 Y3 GND Y4 /I4 Y5 /I5 Y6 /I6 EO2 VCC ЛН6",
"74367" :"' / / / / / / GND / / / / / / /VCC ЛП11",
"74373" :"RG EO /Q0 /D0 /D1 /Q1 /Q2 /D2 /D3 /Q3 GND /PE /Q4 /D4 /D5 /Q5 /Q6 /D6 /D7 /Q7 /VCC ИР22",
"74374" :"RG EO /Q0 /D0 /D1 /Q1 /Q2 /D2 /D3 /Q3 GND /C /Q4 /D4 /D5 /Q5 /Q6 /D6 /D7 /Q7 /VCC ИР23",
"74377" :"RG PE /Q0 /D0 /D1 /Q1 /Q2 /D2 /D3 /Q3 GND /C /Q4 /D4 /D5 /Q5 /Q6 /D6 /D7 /Q7 /VCC ИР27",
"74381" :"ALU /A1 /B1 /A0 /B0 /S0 /S1 /S2 /F0 /F1 GND /F2 /F3 /G /P /Cn /B3 /A3 /B2 /A2 /VCC ИК2",
"74384" :"MUL CLR /X3 /X2 /X1 /X0 /S /C GND /M /K /X7 /X6 /X5 /X4 /Y /VCC ИП9",
"74385" :"SM /C /S1 /S/A1 /B1 /A1 /A2 /B2 /S/A2 /S2 GND /CLR /S3 /S/A3 /B3 /A3 /A4 /B4 /S/A4 /S4 /VCC ИМ7",
"74395" :"RG R /DS /D0 /D1 /D2 /D3 /PE GND EO C Q3 /Q3 /Q2 /Q1 /Q0 /VCC ИР25",
"74482" :"ВГ1",
"74630" :"ВЖ1",
"74670" :"RAM /D2 /D3 /D4 /Rb /Ra /Q4 /Q3 GND /Q2 /Q1 RE WE /Wb /Wa /B1 /VCC ИР26",
"8253" :"TIMER /D7 /D6 /D5 /D4 /D3 /D2 /D1 /D0 /CLC1 /OUT1 /GATE1 GND /OUT2 /GATE2 /CLC2 /GATE3 /OUT3 /CLC3 /A0 /A1 CS RD WR /VCC ВИ53",
"8255" :"PORT /Pa3 /Pa2 /Pa1 /Pa0 RD CS GND /A1 /A0 /Pc7 /Pc6 /Pc5 /Pc4 /Pc0 /Pc1 /Pc2 /Pc3 /Pb0 /Pb1 /Pb2 /Pb3 /Pb4 /Pb5 /Pb6 /Pb7 /VCC /D7 /D6 /D5 /D4 /D3 /D2 /D1 /D0 /RES WR /Pa7 /Pa6 /Pa5 /Pa4 ВВ55",
"8257" :"DMA RD WR MEMR MEMW M128 /RDY /HLDA /ADSTB /AEN /HRQ CS /CLK /RESET /DACK2 /DACK3 /DRQ3 /DRQ2 /DRQ1 /DRQ0 /Gnd /D7 /D6 /D5 /DACK1 /DACK0 /D4 /D3 /D2 /D1 /D0 /Vcc /A0 /A1 /A2 /A3 /TC /A4 /A5 /A6 /A7 ВТ57",
"8282" :"RG /0 /1 /2 /3 /4 /5 /6 /7 OE GND STB /0 /1 /2 /3 /4 /5 /6 /7 VCC ИР82",
"M8212" :"RG DS1 /MD /Di1 /Do1 /Di2 /Do2 /Di3 /Do3 /Di4 /Do4 /STB /GND /DS2 CLR /Do5 /Di5 /Do6 /Di6 /Do7 /Di7 /Do8 /Di8 INT /Vcc ИР12",
"27128" :"ROM / /A12 /A7 /A6 /A5 /A4 /A3 /A2 /A1 /A0 /D0 /D1 /D2 GND /D3 /D4 /D5 /D6 /D7 CS /A10 OE /A11 /A9 /A8 /A13 /PRG /VCC ROM",
"HM6516_9":"RAM /A7 /A6 /A5 /A4 /A3 /A2 /A1 /A0 /D0 /D1 /D2 GND /D3 /D4 /D5 /D6 /D7 /CS /A10 /OE W/R /A9 /A8 /VCC 537РУ10",
"Z80" :"CPU /A11 /A12 /A13 /A14 /A15 /CLK /D4 /D3 /D5 /D6 /Vcc /D2 /D7 /D0 /D1 INT NMI HALT MREQ IORQ RD WR BUSAK WAIT BUSRQ RESET M1 REFSH GND /A0 /A1 /A2 /A3 /A4 /A5 /A6 /A7 /A8 /A9 /A10 Z80",
},
alphabet:"",
alphaset:null,
pinalpha:"",
pinimage:null,
accelerator :[],
accelerators :[],
tracer :[],
sticker :[], // Patterns of all symbols
stickers:[], // All patterns summary
beatle :{
start :[],
x :0,
y :0,
z :0,
stack :[],
table :[],
timer :0
}
},
animation = [],
animated = false,
url,
cnv,
c2d,
edit,
sheet = [],
crafts,
drafts,
sheets,
image,
insert = false,
trigger = true,
timer = 0;
function editing(event) {
var code;
if(window.event)
code = window.event.keyCode;
else
code = event.which;
if(code == 45) {
insert ^= trigger;
if(!insert)
setTimeout("edit.selectionEnd = edit.selectionStart;", 1);
}
switch(code) {
case 33: case 34: case 36: case 37: case 38: case 39: case 40:
clearTimeout(timer);
timer = setTimeout("read(edit.value)", 5000);
insert = false;
return 0;
default:
clearTimeout(timer);
timer = setTimeout("read(edit.value)", 1750);
if(insert)
setTimeout("edit.selectionEnd = edit.selectionStart + 1;", 1);
}
return 0;
}
function setter(letters, crafts, cnv, c2d) {
var i, j, x, y, z, map, pens, raster, pixels, points, img, ink, patterns, regs, blank = [], trace;
var icons = document.createElement("canvas");
var icont = icons.getContext("2d");
var icox = 0, icoy = 0;
icons.width = 640;
icons.height = 13*16;
map = crafts.shift().match(/^.+$/gm);
letters.alphabet = map.shift().split(/\s+/).join("");
letters.height = map.length;
letters.width = map[0].split(/\s+/)[0].length;
cnv.width = letters.width;
cnv.height = letters.height;
raster = c2d.getImageData(0, 0, cnv.width, cnv.height);
pixels = raster.data;
pens = map.join("");
for(x = 0; x < pens.length; ++ x) {
ink = pens[x] != "." ? letters.palette[pens[x]] : 0x00FFFFFF;
if(!ink)
ink = letters.palette["."];
pixels[x * 4 + 0] = (ink[0] >> 0) & 0xFF;
pixels[x * 4 + 1] = (ink[0] >> 8) & 0xFF;
pixels[x * 4 + 2] = (ink[0] >> 16) & 0xFF;
pixels[x * 4 + 3] = (ink[0] >> 24) & 0xFF;
}
c2d.putImageData(raster, 0, 0);
letters.alphaset = new Image();
letters.alphaset.src = cnv.toDataURL("image/gif");
map = crafts.shift().match(/^.+$/gm);
letters.pinalpha = map.shift().split(/\s+/).join("");
letters.height = map.length;
letters.width = map[0].split(/\s+/)[0].length;
cnv.width = letters.width;
cnv.height = letters.height * 2;
raster = c2d.getImageData(0, 0, cnv.width, cnv.height);
pixels = raster.data;
pens = map.join("");
i = 0;
for(y = 0; y < 2; ++ y) {
for(x = 0; x < pens.length; ++ x) {
ink = pens[x] != "." ? letters.palette[pens[x].replace(";", "Z")] : 0x00FFFFFF;
if(!ink)
ink = letters.palette["."];
pixels[i ++] = (ink[0] >> 0) & 0xFF;
pixels[i ++] = (ink[0] >> 8) & 0xFF;
pixels[i ++] = (ink[0] >> 16) & 0xFF;
pixels[i ++] = (ink[0] >> 24) & 0xFF;
}
pens = pens.replace(/;/g, ".");
}
c2d.putImageData(raster, 0, 0);
letters.pinimage = new Image();
letters.pinimage.src = cnv.toDataURL("image/gif");
map = crafts[0].match(/^.+$/gm);
letters.height = map.length;
letters.width = map[0].split(/\s+/)[0].length;
cnv.width = letters.width * 2;
cnv.height = letters.height;
raster = c2d.getImageData(0, 0, cnv.width, cnv.height);
pixels = raster.data;
while(crafts.length) {
map = crafts.shift().match(/^.+$/gm);
if(!map) {
edit.value = map.join("\r\n");
image.src = img.src;
return false;
}
patterns = [];
if(map[0].match(/[_@BCDGLNQRSW][0-9A-F]{16}/))
trace = map.shift();
else
if(map[0].match(/[0-9A-F][0-9A-F][0-9A-F]:[0-9A-F][0-9A-F][0-9A-F]/)
&& map[1].match(/[0-9A-F][_@BCDGLNQRSW][0-9A-F]:[0-9A-F][_@BCDGLNQRSW][0-9A-F]/)
&& map[2].match(/[0-9A-F][0-9A-F][0-9A-F]:[0-9A-F][0-9A-F][0-9A-F]/)) {
points = [11,06,16,04,05,24,14,26,25,02,12,00,01,20,10,22,21];
trace = "";
while(points.length) {
i = points.shift();
trace += map[Math.floor(i / 10)].charAt(i % 10);
}
map.shift(),
map.shift(),
map.shift();
} else
trace = ".0000000000000000";
if(letters.height != map.length || letters.width != map[0].split(/\s+/)[0].length) {
if(letters.height != map.length / 2 && letters.height != map.length / 3 && letters.width != map[0].split(/\s+/)[0].length / 2 && letters.width != map[0].split(/\s+/)[0].length / 3) {
if(map[0].split(/\s+/).length == 1) {
blank = [].concat(map);
continue;
}
edit.value = map.join("\r\n");
image.src = img.src;
return false;
}
var letter = [], pat = [], ico = [];
if(map.join("").indexOf("@") >= 0) {
x = -999, y = -999, j = map[0].split(/\s+/)[0].length;
for(i = 0; i < map.length; ++ i) {
s = map[i].split("");
for(k = 0; k < j; ++ k) {
if(s[k] == "@")
x = k, y = i, s[k] = ".";
if(k >= x && i >= y && (i - y) < blank.length && (k - x) < blank[0].length && s[k] == ".")
edit.value = map.join("\r\n") + x + ',' + y,edit.style.display = "inline-block",
s[k] = blank[i - y].charAt(k - x);
}
map[i] = s.join("");
}
}
for(i = 0; i < map.length; ++ i) {
points = map[i].split(/\s+/);
pens = points.shift();
j = 0;
while(pens.length >= letters.width) {
s = "";
for(k in points)
s += " " + points[k].substr(j, 3);
if(s.length) {
if(!pat[j])
pat[j] = [];
pat[j].push(s);
}
if(!i)
letter.push([]);
s = pens.substr(0, letters.width);
letter[j ++].push(s);
pens = pens.substr(letters.width);
}
}
for(i in letter) {
j = 0; k = 0;
while(letter[i].length) {
s = letter[i].shift();
if(j < 3)
s += " " + pat[i][k + j];
ico.push(s);
++ j;
if(j == letters.height)
crafts.unshift(ico.join("\r\n")),
patterns.unshift(ico.join("\r\n")),
ico = [],
j = 0, ++ k;
}
}
continue;
}
for(j in map) {
points = map[j].split(/\s+/);
pens = points.shift().split("");
if(letters.width != pens.length) {
edit.value = map.join("\r\n");
image.src = img.src;
return false;
}
y = j * cnv.width * 4;
z = y + letters.width * 4;
for(x in pens) {
ink = letters.palette[pens[x]];
if(!ink)
ink = letters.palette["."];
pixels[y + x * 4 + 0] = (ink[0] >> 0) & 0xFF;
pixels[z + x * 4 + 0] = (ink[1] >> 0) & 0xFF;
pixels[y + x * 4 + 1] = (ink[0] >> 8) & 0xFF;
pixels[z + x * 4 + 1] = (ink[1] >> 8) & 0xFF;
pixels[y + x * 4 + 2] = (ink[0] >> 16) & 0xFF;
pixels[z + x * 4 + 2] = (ink[1] >> 16) & 0xFF;
pixels[y + x * 4 + 3] = (ink[0] >> 24) & 0xFF;
pixels[z + x * 4 + 3] = (ink[1] >> 24) & 0xFF;
}
for(x in points) {
pens = points[x];
regs = pens.length < 6 ? "" : pens;
z = regs ? 0 : pens.length;
while(z --)
regs = (pens.charAt(z) == "." ? ".." : pens.charCodeAt(z).toString(16).toUpperCase()) + regs;
patterns[x] = j > 0 ? patterns[x] + regs : regs;
}
}
c2d.putImageData(raster, 0, 0);
img = new Image();
img.src = cnv.toDataURL("image/gif");
icont.drawImage(img, 0, 0, letters.width, letters.height, icox, icoy, letters.width, letters.height);
icoy += letters.height;
if(icoy + letters.height > icons.height)
icoy = 0,
icox += letters.width;
letters.stickers.push("(" + patterns.join("|") + ")");
letters.accelerators.unshift("(" + patterns.join("|") + ")");
letters.sticker[patterns.join("|")] = img,
letters.tracer[patterns.join("|")] = trace,
letters.accelerator.unshift(patterns.join("|"));
// for(j in patterns)
// letters.accelerator.unshift(patterns[j]),
// letters.sticker[patterns[j]] = img;
}
letters.stickers = new RegExp(letters.stickers.join("|"));
letters.accelerators = new RegExp(letters.accelerators.join("|"));
var icon = new Image();
icon.src = icons.toDataURL("image/gif");
document.body.appendChild(icon);
return true;
}
function pinshow(s, x, y, d, z) {
var
w = letters.pinimage.width / letters.pinalpha.length, h = letters.pinimage.height / 2, v = 0, p, q;
if(s.charAt(0) == "/")
s = s.substr(1),
v = h;
if(s.indexOf("/") >= 0 && d < 0)
v ^= h;
q = s.split("");
x = (x - 1) * letters.width;
if(!d)
x -= ((w * s.length) >> 1) + (w >> 1), d = +1;
y = y * h - h * z / 2;
d *= w;
if(d > 0)
x += d;
while(q.length) {
x += d;
s = d < 0 ? q.pop() : q.shift();
p = letters.pinalpha.indexOf(s) * w;
if(s == "/")
v ^= h;
c2d.drawImage(letters.pinimage, p, v, w, h, x, y, w, h);
}
}
function pining(name, id, input, output, x, y, cells) {
var width = 0, x1 = x, z, y1 = y, i, s, w, tape, pin, pins;
pins = letters.chips[id];
if(!id || !name || !pins) {
if(cells[y][x + 2] != "23") {
while(x > 1 && cells[y][x] != "23")
-- x;
y1 = y; x1 = x;
while(output.length) {
while(y1 > 0 && cells[y1][x1 + 1] != "2D")
-- y1;
pin = output.pop();
pinshow(pin, x1, -- y1, +1, 1);
}
} else
x += 2;
y1 = y; x1 = x;
while(input.length) {
while(y1 > 0 && cells[y1][x1 - 1] != "2D")
-- y1;
pin = input.pop();
pinshow(pin, x1, -- y1, -1, 1);
}
return;
}
y1 = y; x1 = x + 1;
while(output.length) {
while(y1 > 0 && cells[y1][x1] != "2D")
-- y1;
pin = output.pop();
pinshow(pins.split(" ")[pin], x, -- y1, -1, 0);
pinshow("/" + pin, x, y1, +1, 1);
}
y1 = y + 1; x1 = -1;
while(x > 1 && ["2D", "2B"].indexOf(cells[y1][x]) >= 0)
x1 = cells[y][x] == "2E" ? x : x1,
-- x;
x += 1;
while(input.length) {
while(y1 > 0 && (cells[y1][x - 1] != "2D"))
-- y1;
pin = input.pop();
pinshow(pins.split(" ")[pin], x, y1 - 1, +1, 0);
pinshow("/" + pin, x, y1 - 1, -1, 1);
-- y1;
}
pinshow("/" + name, x1, y - 1, +0, 0);
while(y > 0 && (cells[y][x1] != "2D"))
-- y;
s = pins.split(" ")[0];
z = s.charAt(0) == "`" ? +1 : 0;
z = s.charAt(0) == "'" ? -1 : z;
if(z)
s = s.substr(1);
pinshow("/" + s, x1, y, z, 0);
}
function read(draft, text, rows) {
var
mask = [],
unm, uid,
x, y, z, zz, p, w, v, h, overline,
y1, y2,
tape, alpha, ping,
width, height, tops = 0,
tags = [],
pat, symbol, s,
cells, alphabet = new RegExp("[^" + letters.alphabet + "]", "gm"),
tracing = [[]];
clearTimeout(letters.beatle.timer);
letters.beatle.timer = 0;
letters.beatle.start = [];
if(!rows)
rows = -1;
draft = draft.replace(/^[A-Z][0-9_A-Z-+:;*@/].*$|^\*[A-Z]*[1-9][0-9]+[A-Z_0-9]*-.+$|^.\#[A-Z0-9a-z-\/,]+$/gim, function(s) {
if(s.charAt(0) == "*" || s.charAt(0) == "#") {
letters.chips[s.substr(1).split("-")[0]] = s.substr(s.indexOf("-") + 1);
return "";
} else if(!tags[s.charAt(0).toUpperCase()])
tags[s.charAt(0).toUpperCase()] = [];
tags[s.charAt(0).toUpperCase()] = tags[s.charAt(0).toUpperCase()].concat((s.charAt(0).toUpperCase() != s.charAt(0) ? s.substr(1) : s).split(/\s+/));
-- tops;
return "";
});
draft = draft.split(/\r?\n/);
draft.pop();
draft.length += tops;
width = draft[0].length, height = draft.length;
if(cnv.height != letters.height * height && rows < 0)
cnv.height = letters.height * height,
edit.rows = tags.length + height,
edit.style.fontSize = letters.height + "px",
edit.style.lineHeight = letters.height + "px";
y = height;
letters.beatle.table = [[]];
while(-- y)
width = width > (x = draft[y].length) ? width : x,
letters.beatle.table.push([]);
for(y in tracing)
for(z = 0; z < width; ++ z)
letters.beatle.table[y].push(".0000000000000000");
if(edit.cols != width && rows < 0)
edit.cols = width,
cnv.width = letters.width * width;
for(y = 0, cells = new Array(); y <= height + 1; ++ y)
for(x = 0, cells[y] = new Array(), mask.push(rows < 0 || ((y - 0) <= rows && (y + 2) >= rows)); x <= width + 1; ++ x)
cells[y][x] = y && y <= height && x && x <= draft[y - 1].length ? draft[y - 1].charCodeAt(x - 1).toString(16).toUpperCase() : "20";
animation = [];
for(x = 0; x < width; ++ x) for(y = 0; y < height; ++ y) {
if(!mask[y])
continue;
pat = cells[y][x] + cells[y][x + 1] + cells[y][x + 2] + cells[y + 1][x] + cells[y + 1][x + 1] + cells[y + 1][x + 2] + cells[y + 2][x] + cells[y + 2][x + 1] + cells[y + 2][x + 2];
z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(zz = String.fromCharCode(parseInt(cells[y + 1][x + 1], 16)));
if(!text && z >= 0 && tags[zz] && tags[zz][0]) {
if(rows < 0)
for(z in letters.sticker) {
c2d.drawImage(letters.sticker[z], 0, 0, letters.width, letters.height, x * letters.width, y * letters.height, letters.width, letters.height);
if(tags[zz])
s = tags[zz].shift();
if(s.match(/([A-Z][1-9][0-9]*(\.[1-9])?)(?:\*)([A-Z1-9][0-9_A-Z]+)(-[1-9][0-9]*(,[1-9][0-9]?)*)(-[1-9][0-9]*(,[1-9][0-9]?)*)/g)) {
s = s.split(/-/);
pining(s[0].split("*")[0], s[0].split("*")[1], s[1].split(","), s[2].split(","), x, y, cells);
break;
}
if(s.match(/\#[A-Z0-9a-z-\/,]+/g)) {
s = s.substr(1).split(/-/);
pining("", "", s[0].split(","), s[1].split(","), x, y, cells);
break;
}
v = (y - s.split(/;/).length + 1) * letters.height - 1;
tape = letters.alphaset; alpha = letters.alphabet; h = tape.height;
ping = false; overline = 0;
if(s.charAt(0) == "@")
tape = letters.pinimage, alpha = letters.pinalpha, s = s.substr(1),
w = tape.width / alpha.length, h = tape.height / 2,
overline = h,
p = v - w * (s.split(/;/)[0].split(/:/).length + 1);
else
if(s.charAt(0) == "_")
ping = true,
tape = letters.pinimage, alpha = letters.pinalpha, s = s.substr(1),
w = tape.width / alpha.length, h = tape.height / 2,
overline = h,
p = v - w * (s.split(/;/)[0].split(/:/).length + 1) - h / 2;
else
w = tape.width / alpha.length,
p = v - w * s.split(/;/)[0].split(/:/).length;
zz = (x + 1) * letters.width - w * s.split(/;/)[0].split(":")[0].length;
while(s) {
if(s.charAt(0) == ";") {
v += letters.height;
s = s.substr(1);
p = v - w - w * s.split(/;/)[0].split(/:/).length - (ping ? tape.height / 2 : 0);
zz = (x + 1) * letters.width - w * s.split(/;/)[0].split(":")[0].length;
continue;
} else
if(s.charAt(0) == ":") {
p -= h;
s = s.substr(1);
zz = (x + 1) * letters.width - w * s.split(/;/)[0].split(":")[0].length;
continue;
}
z = alpha.indexOf(s.charAt(0));
s = s.substr(1);
try {c2d.drawImage(tape, z * w, overline, w, h, zz, p + letters.height, w, h);} catch(e) {}
zz += w;
}
break;
}
continue;
}
symbol = [];
/* if(text)
for(z in letters.sticker)
if(pat.match(z))
symbol.push(z);
else
continue;
else
for(z in letters.accelerator)
if(pat.match(letters.accelerator[z]))
symbol.push(letters.accelerator[z]);
else
continue;*/
if(text) {
z = pat.match(letters.stickers);
z = z.slice(1).join(" ").replace(/[^\s]+\s+$/,"").length;
for(var z0 in letters.sticker)
if(z -- == 0)
symbol.push(z0);
else
continue;
} else {
z = pat.match(letters.accelerators);
z = z.slice(1).join(" ").replace(/[^\s]+\s+$/,"").length;
if(letters.accelerator[z])
symbol.push(letters.accelerator[z]);
/*for(var z0 in letters.accelerator)
if(z -- == 0)
symbol.push(letters.accelerator[z0]);
else
continue;*/
}
if(symbol.length) {
z = text || true ? symbol.shift() : symbol.pop(),
c2d.drawImage(letters.sticker[z], (text ? letters.width : 0), 0, letters.width, letters.height, x * letters.width, y * letters.height, letters.width, letters.height),
letters.beatle.table[y][x] = letters.tracer[z];
if(letters.tracer[z].charAt(0) == "N") {
letters.beatle.x = -1,
letters.beatle.y = -1;
letters.beatle.start.push({x: x, y: y});
letters.beatle.stack.push({x: x, y: y - 1, z: 0});
letters.beatle.stack.push({x: x + 1, y: y, z: 1});
letters.beatle.stack.push({x: x, y: y + 1, z: 2});
letters.beatle.stack.push({x: x - 1, y: y, z: 3});
}
}
}
image.src = cnv.toDataURL("image/gif");
//if(animated)
document.getElementById("beatle").style.display = "inline-block",
buggy();
}
function buggy() {
var dir = [
{x:-0,y:-1},
{x:+1,y:+0},
{x:+0,y:+1},
{x:-1,y:-0}
],
k, c, i;
k = letters.beatle.y >= 0 && letters.beatle.x >= 0 && letters.beatle.y < letters.beatle.table.length && letters.beatle.x < letters.beatle.table[0].length && letters.beatle.table[letters.beatle.y] ? letters.beatle.table[letters.beatle.y][letters.beatle.x] : ".";
if("@_BCDGLQRSW".indexOf(k.charAt(0)) >= 0) {
c = (parseInt(k.substr(-8), 16) >> (letters.beatle.z << 3)) & 15;
if(((c >> letters.beatle.z) & 1) == 0)
k = ".";
i = 0;
while(c) {
if((c & 1) && (i != letters.beatle.z))
letters.beatle.stack.push({
x :letters.beatle.x + dir[i].x,
y :letters.beatle.y + dir[i].y,
z :i
});
c >>= 1;
++ i;
}
}
while(letters.beatle.stack.length && (letters.beatle.y < 0 || letters.beatle.x < 0 || letters.beatle.y >= letters.beatle.table.length || letters.beatle.x >= letters.beatle.table[0].length || !letters.beatle.table[letters.beatle.y] || "@_BCDGLQRSW".indexOf(k.charAt(0)) < 0)) {
var next = letters.beatle.stack.shift();
letters.beatle.x = next.x,
letters.beatle.y = next.y,
letters.beatle.z = next.z;
k = letters.beatle.y >= 0 && letters.beatle.x >= 0 && letters.beatle.y < letters.beatle.table.length && letters.beatle.x < letters.beatle.table[0].length && letters.beatle.table[letters.beatle.y] ? letters.beatle.table[letters.beatle.y][letters.beatle.x] : ".";
if(k && "@_BCDGLQRSW".indexOf(k.charAt(0)) >= 0) {
c = (parseInt(k.substr(-8), 16) >> (letters.beatle.z << 3)) & 15;
if(((c >> letters.beatle.z) & 1) == 0)
k = ".";
}
}
document.getElementById("beatle").style.left = (document.getElementById("image").offsetLeft + 13 * letters.beatle.x) + "px";
document.getElementById("beatle").style.top = (document.getElementById("image").offsetTop + 13 * letters.beatle.y) + "px";
letters.beatle.x += dir[letters.beatle.z].x,
letters.beatle.y += dir[letters.beatle.z].y;
document.title = document.getElementById("image").offsetLeft + "," + document.getElementById("image").offsetTop + "/" + letters.beatle.x + "," + letters.beatle.y + ":" + letters.beatle.z;
if(letters.beatle.y >= 0 && letters.beatle.x >= 0 && letters.beatle.y <= letters.beatle.table.length && letters.beatle.x <= letters.beatle.table[0].length)
letters.beatle.timer = setTimeout(buggy, 150);
else {
i = 0;
while(i < letters.beatle.start.length) {
var start = letters.beatle.start[i ++];
letters.beatle.stack.push({x: start.x, y: start.y - 1, z: 0}),
letters.beatle.stack.push({x: start.x + 1, y: start.y, z: 1}),
letters.beatle.stack.push({x: start.x, y: start.y + 1, z: 2}),
letters.beatle.stack.push({x: start.x - 1, y: start.y, z: 3});
}
letters.beatle.timer = setTimeout(buggy, 5);
}
}
function main() {
var sch = new Schemer(document.getElementsByTagName("pre")[0].textContent);
var schema, args = "";
url = window.location.href.split("?");
if(url.length > 1)
args = url.pop();
url = url.join("?");
cnv = document.getElementsByTagName("canvas")[0];
c2d = cnv.getContext("2d");
crafts = document.getElementsByTagName("div")[args.match(/version=7x7/) ? 1 : 0].textContent.split(/^$/m);
letters.palette["L"] = args.match(/smooth=on/) ? [0xFFFFFFFF, 0xFFFFFFFF] : [0xFF000000, 0xFF000000],
letters.palette["J"] = args.match(/smooth=on/) ? [0xFF000000, 0xFF000000] : [0xFFFFFFFF, 0xFFFFFFFF];
drafts = document.getElementsByTagName("pre");
sheets = document.getElementsByTagName("select")[0];
edit = document.getElementsByTagName("textarea")[0];
image = document.getElementById("image");
for(var i in drafts) {
if(drafts[i].title) {
option = sheets.add(new Option("[" + drafts[i].title + "]", i), null);
option = sheets.add(new Option('"' + drafts[i].title + '"', i), null);
}
}
if(!setter(letters, crafts, cnv, c2d))
return edit.style.display = "inline-block";
if(args.match(/draw=/))
edit.style.display = "none",
animated = true;
if(schema = args.match(/(?:edit|show|draw)=([0-9]+)/))
read(edit.value = drafts[schema[1]].textContent);
else
if(schema = args.match(/(?:edit|show|draw)=([^&]+)/))
read(edit.value = unescape(schema[1]));
else
read(edit.value = drafts[0].textContent);
if(!args.match(/show|draw=/))
edit.style.display = "inline-block",
document.getElementsByTagName("select")[0].style.display = "block",
document.getElementsByTagName("p")[0].style.display = "block";
edit.onkeydown = editing;
edit.onkeyup = function() {
read(edit.value, false, edit.value.substr(0, edit.selectionStart).split(/\r?\n/).length);
}
if (navigator.userAgent.indexOf('MSIE') != -1)
var detectIEregexp = /MSIE (\d+\.\d+);/ //test for MSIE x.x
else // if no "MSIE" string in userAgent
var detectIEregexp = /Trident.*rv[ :]*(\d+\.\d+)/ //test for rv:x.x or rv x.x where Trident string exists
if(detectIEregexp.test(navigator.userAgent))
trigger = false;
//window.addEventListener( "offline", function(){showWarningDiv("on")}, false);
//window.addEventListener( "online", function(){showWarningDiv("off")}, false);
}
function showWarningDiv(status){
var warningdiv = document.getElementById("warning");
if (status == "on"){
warningdiv.innerHTML = "<p style=\"padding:3px; display:block;\">Right now you are in offline mode. This message is saved and will be sent to the server the next time you are online.</p>";
} else {
warningdiv.innerHTML = "------------------------";
}
}
/*
704 > -7--6--5--4--3--2--1--0
3.1 > 80-40-20-10-08-04-02-01
625
.!. [0]=321->0x......0E
-*- [1]=320->0x....0D..
.!. [2]=310->0x..0B....
[3]=210->0x07......
*/
</script></head>
<body onload='main()' onmouseover='document.getElementsByTagName("p")[0].style.display = "block"'>
<select onchange='sheet = []; read(edit.value = drafts[this.selectedIndex >> 1].textContent, this.selectedIndex & 1)'></select>
<nobr><textarea rows='40' cols='80'></textarea><img id='image' /><span id='beatle' style='display:none; position:absolute; left:40; top:90; color:red'>§</span></nobr><br />
<canvas width='640px' height='480px'></canvas>
<pre title='Passive Primitives'>
!!!!! +--+---+--+
!!!!+--! ! ! !----
!!!! ! ! +--+
!!!! ! ! ! o----
!!!! +--+ ! o----
!!!! ! ! ! o----+
!!!+---! ! +--+ !
!!! ! ! ! !----+----#
!!! +--+ ! !----+----#
!!! ! ! ! !----+----# #
!!+----! ! ! !----+----# #
!! ! ! ! !----+----# #
!! +--+ ! !----+----# #
!! ! ! ! !----+----# #
!*-----! ! ! !----+----# #
!! ! ! +--+ ! #################
!! ! ! ! !----+----# #
!! +--+ ! !----+----# #
!! +-! ! ! !----+----# #
!! ! ! ! ! !----+----# #
!! *-! ! ! !----+----# +-+--+-+ #
!! ! ! ! ! !----+----#-----! ! ! ! #
!! +-+-! ! ! !----+----#-----! ! ! ! #
!! ! ! ! ! ! !----+----#-----! ! ! ! #
!!++-+-! ! +--+ ! #-----! ! ! !--#
!!!! ! +--+ ! !----+---+#-----! ! ! !--#
!!!! = ! ! ! !----+-+ !#-----! ! ! !--#
!!!! ! ! +--+ ! ! !#-----! ! ! !--#
!!!!+--o ! ! !---+! ! !#-*---! ! ! !--#
!!!!! ! ! . ! !-+ !! ! !#W! +-+ ! !--#
!!!!! +--+---+--+U! !! ! +--+---! ! ! !--#
!!!!! +------------+ !! +----+---! ! ! !--#
!!!!! ! +------------++------+ +-o ! ! ! #
!!!!! ! ! +-+--+ !! *-! ! ! ! #
!!!!! ! +-! ! !---+ !*-\\---+ = +-+ ! ! #
!!!!! +---/ !. ! ! !! <-*---! !. ! ! #
!!!!! +-+--+U \ !! +-+--+-+U #W
!!!!! ! !! ###################
!!!!! VT2<-+ !!
UX1*7474-12,11-8
U2*8257-7,12,6,13,19,18,17,16,11-10,4,2,1,32,33,34,35,37,38,39,40,30,29,28,27,26,23,22,21,8,9,14,15
U7*M8212-3,5,7,9,16,18,20,22,11,15,1,2,14-4,6,8,10,15,17,19,21
w#/9,/10,/11,/12,/13,/14,/15,/16,/1,/2,/3,/4,/5,/6,/7,/8-/1,/2,/3,/4,/5,/6,/7,/8
w#/17,/18,/19,/20,/21,/22,/23,/24-
</pre>
<pre title='Passive Primitives'>
############################################################
+---+ +-+---+-+ # # #
! ! ! ! ! ! !---# +-+---+-+ +--+---+--+ # +-+---+-+ +--+---+--+ #
! =]+---\ ! ! !---# ! ! ! !---! ! ! !---# ! ! ! !---! ! ! !---#
! ! ! ! ! . ! !---# ! ! ! !---! ! ! !---# ! ! ! !---! ! ! !---#
+---+ +-+---+-+U W ! ! ! !---! ! ! !---# ! ! ! !---! ! ! !---#
+--\ ! . ! !---! ! ! !---# +-\ ! . ! !---! ! ! !---#
+---+ ! +-+---+-+U+-! ! . ! ! W! +-+---+-+U+-! ! . ! ! W
! ! ! ! ! +--+---+--+U+-+ ! ! +--+---+--+U
! =]+---------------*------------*-------------!.o-*-----------+
! ! ! +-+U
+---+
U1*CNT99-1-2,4,5
U2*CNT99-1-2,3,4,5
U3*RAM99-1,2,3,4,5-6,7,8,9
U4*7404-1-2
U5*CNT99-1-2,3,4,5
U6*RAM99-1,2,3,4,5-6,7,8,9
w#/T0,/T1,/Tn-
w#/T0,/T1,/Tm,/Tn-
w#/T0,/T1,/Tm,/Tn-
*CNT99-CT2 C /Q0 /Q1 /.. /Qn
*RAM99-RAM /A1 /A2 /.. /An /WR /D0 /D1 /.. /Dn
</pre>
<!--U2*1B-5-1
U3*1C-5-6
W#/T0,/T1,/Tn
W#/T0,/T1,/Tn
</pre-->
<pre title='Passive Primitives'>
@--:---*----:----*----:----*----:----*----:----*->
! \ ! \ ! \ ! STB !