Skip to content

Commit 93d738b

Browse files
committed
Update sl.c
Adding dancers to the locomotive top. Inspired by song "chaiya-chaiya(Shahrukh Khan)".
1 parent 0fd8d6f commit 93d738b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

sl.c

+41
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
void add_smoke(int y, int x);
4545
void add_man(int y, int x);
46+
void add_fdancer(int y, int x);
47+
void add_mdancer(int y, int x);
4648
int add_C51(int x);
4749
int add_D51(int x);
4850
int add_sl(int x);
@@ -53,6 +55,7 @@ int ACCIDENT = 0;
5355
int LOGO = 0;
5456
int FLY = 0;
5557
int C51 = 0;
58+
int DANCE = 0;
5659

5760
int my_mvaddstr(int y, int x, char *str)
5861
{
@@ -73,6 +76,7 @@ void option(char *str)
7376
case 'F': FLY = 1; break;
7477
case 'l': LOGO = 1; break;
7578
case 'c': C51 = 1; break;
79+
case 'd': DANCE = 1; break;
7680
default: break;
7781
}
7882
}
@@ -150,6 +154,13 @@ int add_sl(int x)
150154
add_man(y + 1 + py2, x + 45); add_man(y + 1 + py2, x + 53);
151155
add_man(y + 1 + py3, x + 66); add_man(y + 1 + py3, x + 74);
152156
}
157+
if (DANCE == 1 && ACCIDENT == 0 && FLY == 0) {
158+
add_mdancer(y - 2, x + 21);
159+
add_fdancer(y + py2 - 2, x + 45);
160+
add_fdancer(y + py2 - 2, x + 50); add_fdancer(y + py2 - 2, x + 55);
161+
add_mdancer(y + py3 - 2, x + 66);
162+
add_mdancer(y + py3 - 2, x + 71); add_mdancer(y + py3 - 2, x + 76);
163+
}
153164
add_smoke(y - 1, x + LOGOFUNNEL);
154165
return OK;
155166
}
@@ -191,6 +202,9 @@ int add_D51(int x)
191202
add_man(y + 2, x + 43);
192203
add_man(y + 2, x + 47);
193204
}
205+
if (DANCE == 1 && ACCIDENT ==0 && FLY == 0) {
206+
add_mdancer(y - 2, x + 43); add_fdancer(y - 2, x + 48);
207+
}
194208
add_smoke(y - 1, x + D51FUNNEL);
195209
return OK;
196210
}
@@ -231,6 +245,9 @@ int add_C51(int x)
231245
add_man(y + 3, x + 45);
232246
add_man(y + 3, x + 49);
233247
}
248+
if (DANCE == 1 && ACCIDENT ==0 && FLY == 0) {
249+
add_mdancer(y - 1, x + 45); add_fdancer(y - 1, x + 50);
250+
}
234251
add_smoke(y - 1, x + C51FUNNEL);
235252
return OK;
236253
}
@@ -245,6 +262,30 @@ void add_man(int y, int x)
245262
my_mvaddstr(y + i, x, man[(LOGOLENGTH + x) / 12 % 2][i]);
246263
}
247264
}
265+
void add_fdancer(int y, int x)
266+
{
267+
static char *fdancer[2][3] = {{"\\\\0", "/\\", "|\\"}, {"0//", "/\\", "/|"}};
268+
static char *Efdancer[2][3] = {{" ", " ", " "}, {" ", " ", " "}};
269+
int i;
270+
271+
for (i = 0; i<3; ++i) {
272+
my_mvaddstr(y+i, x + 1, Efdancer[(LOGOLENGTH + x) / 12 %2][i]);
273+
my_mvaddstr(y+i, x, fdancer[(LOGOLENGTH + x) / 12 %2][i]);
274+
}
275+
}
276+
277+
void add_mdancer(int y, int x)
278+
{
279+
static char *mdancer[3][3] = {{"_O_", " #", "/\\"}, {"(0)", " #", "/\\"}, {"(O_", " #", "/\\"}};
280+
static char *Emdancer[3][3] = {{" ", " ", " "}, {" ", " ", " "}, {" ", " ", " "}};
281+
int i;
282+
283+
for (i = 0; i<3; ++i) {
284+
my_mvaddstr(y+i, x + 1, Emdancer[(LOGOLENGTH + x) / 12 %3][i]);
285+
my_mvaddstr(y+i, x, mdancer[(LOGOLENGTH + x) / 12 %3][i]);
286+
287+
}
288+
}
248289

249290

250291
void add_smoke(int y, int x)

0 commit comments

Comments
 (0)