@GbaLog-
Любитель чаепитий
3116 / 1455 / 351
Регистрация: 24.08.2014
Сообщений: 5,167
|
16.07.2016, 18:03
|
|
rik2home, А игрушки где? И мигания?
Добавлено через 36 минут
Вот с использованием pdcurses.
C++ | 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
| ///////////////////////////////////////////////////////////////////////////////
#include <pdcurses/curses.h>
#include <string>
///////////////////////////////////////////////////////////////////////////////
int main()
{
initscr();
start_color();
init_pair( 1, COLOR_GREEN, COLOR_BLACK );
init_pair( 2, COLOR_RED, COLOR_BLACK );
init_pair( 3, COLOR_YELLOW, COLOR_BLACK );
init_pair( 4, COLOR_BLUE, COLOR_BLACK );
noecho();
curs_set(0);
//-------------------------------------------------------------------------
enum color
{
NONE = 0,
RED = 2,
YELLOW = 3,
BLUE = 4
};
std::string spruce
{
" $ \n"
" **$ \n"
" *$**$ \n"
" $**$**$ \n"
" **$**$**$ \n"
" *$**$**$**$ \n"
" $**$**$**$**$ \n"
" **$**$**$**$**$ \n"
"*$**$**$**$**$**$\n"
" *** \n"
};
color cur_color = RED;
for(;;)
{
move(0,0);
if ( cur_color == RED )
{
cur_color = YELLOW;
}
else if ( cur_color == YELLOW )
{
cur_color = BLUE;
}
else if ( cur_color == BLUE )
{
cur_color = RED;
}
for( const auto& i : spruce )
{
if ( i == '$' )
{
addch( i | COLOR_PAIR(cur_color) | A_BOLD );
}
else
{
addch( i | COLOR_PAIR(1) | A_BOLD );
}
}
napms( 200 );
refresh();
}
//-------------------------------------------------------------------------
endwin();
} |
|
0
|