-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLife.c
More file actions
executable file
·129 lines (95 loc) · 3.25 KB
/
Life.c
File metadata and controls
executable file
·129 lines (95 loc) · 3.25 KB
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
/* (Simple) Version Of The Game Of Life (Originally by John Horton Conway)
It' a test-application to test and develop PoorTUI- Terminal Functions
See detailed description at the EOF !
! Could contain 3rd party MIT/GPL/"FreeSoftware" technologies !
(see detailed comments in related declarations/functions and at the EOF)
This is a ! p_o_o_r ! Application by (c) Pit Demmer. (PIT-Licensed 01.04.2022 - x.x.xxxx)
PIT-licensed" isn't a joke! - Right now I do not know about the license model I wanna use!
But Sources will be free!
I'm just struggling with professional 3rd parties distributing binaries
(or executing a compiling process on customer machines) without contributing to
"FreeSoftware"
*/
#define LifeVersion "1.00pa"
#include "Terminal.h"
#include "AnsiESC.h"
void UserSecondChanged(void){
static int i = 0;
i++;
TERM_RunCoreLoop = 0;
if (i < 15){
//printf("Second\n");
TERM_RunCoreLoop = 1;
}
}
void UserLoop(void){
static int i = 0;
i++;
//printf("Loop: %d\n", i);
}
void UserDblClick(int x, int y, int button){
TERM_RunCoreLoop = 0;
printf("DblClick: %d,%d,%d\n",x ,y, button);
}
int main() {
if (!TermInit()){
return -1;
}
ESCinit();
// *************************************************************
// If You Wanna Change Defaults (see BlaBlaInit())
// ualarm(333333,333333);
// TIME_EventsTime = 10000;
// TermTrapMouse(0); // Disable 1st !
// TermTrapMouse(1); // Then Set New...
// set Timer event(s) on your own function(s)
TimeSecChanged = UserSecondChanged;
// set Terminal event(s) on your own function(s)
TermMouseClicks[TERM_Event_MouseDblClick] = UserDblClick;
// get your colors from INI-file
EscColorSTRUCT *userColors;
if (!ESCinitColors("desktops.ini", userColors)){
TermExit();
return -1;
}
// get your text-styles from INI-file
EscStyleSTRUCT *userStyles;
if (!ESCinitTxtStyles("desktops.ini", userStyles)){
TermExit();
return -1;
}
printf("a b c d e f g h i j k l m n o p q r s t u v w x y z\n");
printf("\x1B(0");
printf("a b c d e f g h i j k l m n o p q r s t u v w x y z\n");
printf("\x1B(B");
// Run TUIs event loop - param is your loop if you have to "ever"-loop something...
// Use a dummy if your app is fully event-driven
TermCoreLoop(UserLoop);
// Set TUI_RunCoreLoop = 0 to reach this point
#if __APPLE__
// NO CLUE WHY freeing is messy
#else
// free(userColors);
// free(userStyles); WHY this free fails, too?
#endif
// *************************************************************
if (!TermExit()){
return -1;
}
return 0;
};
/*
EOF - Detailed Description
Included *.h having 8-Bit AVR's as main target!
App-State : Pre Alpha
App-Version : 1.00pa
App-Date :
Dev-Start : 01.04.2022
1st Alpha :
1st Beta :
1st Release :
STRUCTURES Creation Date Alpha Date BetaDate Creator
Files Creation Date Alpha Date BetaDate Creator
<Life.c> 01.04.2022 Pit
BugID Description Found by / Date Fixed by / Date
*/