* transcode.c (econv_init): accept Encoding object as source_encoding
[ruby-svn.git] / sample / rcs.awk
blob08979285c929844db5e5a41304e88851f7d80c91
1 BEGIN {
2 sw = 40.0;
3 dw = 78.0;
4 hdw = dw / 2.0;
5 w = 20.0;
6 h =1.0;
7 d = 0.2;
8 ss="abcdefghijklmnopqrstuvwxyz0123456789!#$%^&*()-=\\[];'`,./";
9 rnd = srand();
13 xr = -hdw; y = h * 1.0; maxxl = -999;
14 s = "";
15 while (xr < hdw) {
16 x = xr * (1 + y) - y * w / 2;
17 i = (x / (1 + h) + sw /2);
18 c = (0 < i && i < length($0)) ? substr($0, i, 1) : "0";
19 y = h - d * c;
20 xl = xr - w * y / (1 + y);
21 if (xl < -hdw || xl >= hdw || xl <= maxxl) {
22 t = rand() * length(ss);
23 c = substr(ss, t, 1);
25 else {
26 c = substr(s, xl + hdw, 1);
27 maxxl = xl;
29 s = s c;
30 xr = xr + 1;
32 print s;