-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha.c
More file actions
50 lines (44 loc) · 814 Bytes
/
Copy patha.c
File metadata and controls
50 lines (44 loc) · 814 Bytes
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
#include<unistd.h>
void putchar_screen(char c)
{
write(1, &c, 1);
}
void print_f(int index, char char1, char char_middle, char char_final)
{
int index_current;
index_current = 1;
while (index_current <= index)
{
if (index_current == 1)
putchar_screen(char1);
else if (index_current == index)
putchar_screen(char_final);
else
putchar_screen(char_middle);
index_current++;
}
putchar_screen('\n');
}
void rush(int index, int line)
{
int line_current;
line_current = 1;
if (index >= 1 && line >= 1 )
{
while (line_current <= line)
{
if (line_current == 1)
print_f(index, '/', '*', '\\');
else if (line_current == line)
print_f(index, '\\', '*', '/');
else
print_f(index, '*', ' ', '*');
line_current++;
}
}
}
int main(void)
{
rush(4, 4);
return (0);
}