mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[app] Nicer app
This commit is contained in:
27
app/app.cpp
27
app/app.cpp
@@ -7,15 +7,24 @@ extern "C" {
|
||||
#include <poincare.h>
|
||||
|
||||
void ion_app() {
|
||||
|
||||
KDDrawString("Hello, world!", (KDPoint){.x = 10, .y = 10});
|
||||
|
||||
char input[255];
|
||||
|
||||
#if 0
|
||||
while (1) {
|
||||
for (int i =0; i<24;i++) {
|
||||
input[i] = ion_getchar();
|
||||
input[i+1] = 0;
|
||||
KDDrawString(input, (KDPoint){.x = 0, .y = 0});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int index = 0;
|
||||
while (1) {
|
||||
char character = ion_getchar();
|
||||
if (character == '.') {
|
||||
if (character == 'X') {
|
||||
input[index] = 0;
|
||||
index = 0;
|
||||
Expression * e = Expression::parse(input);
|
||||
@@ -26,16 +35,16 @@ void ion_app() {
|
||||
//FIXME delete e;
|
||||
} else {
|
||||
if (index == 0) {
|
||||
KDFillRect((KDRect){
|
||||
.x = 0,
|
||||
.y = 0,
|
||||
.width = 160,
|
||||
.height = 160},
|
||||
0x00);
|
||||
KDRect r;
|
||||
r.x = 0;
|
||||
r.y = 0;
|
||||
r.width = 160;
|
||||
r.height = 160;
|
||||
KDFillRect(r, 0x00);
|
||||
}
|
||||
input[index++] = character;
|
||||
input[index] = 0;
|
||||
KDDrawString(input, (KDPoint){.x = 40, .y = 40});
|
||||
KDDrawString(input, KDPointZero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user