-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gym.c
executable file
·122 lines (112 loc) · 2.44 KB
/
Gym.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
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
// C Source File
// Created 10/2/2002; 12:04:59 AM
//Author: Jeremy F Villalobos
#define USE_TI89 // Compile for TI-89
#define USE_TI92PLUS // Compile for TI-92 Plus
#define USE_V200 // Compile for V200
// #define OPTIMIZE_ROM_CALLS // Use ROM Call Optimization
#define MIN_AMS 100 // Compile for AMS 1.00 or higher
#define SAVE_SCREEN // Save/Restore LCD Contents
#include <tigcclib.h> // Include All Header Files
#include "DateMani.h"
#include <DisplayMani.h>
#include <filemani.h>
// Main Function
// Archivo principal, implementar todas las funciones, Ques se vea simple y nitido !!
void InitSchedule();
void _main(void)
{
FILE *WFile, *PData;
char input[INPUT_SIZE];
int pos = 1; // position of the cursor
struct Gym WorkOut; // structure of a Gym to extract records and store data
if( ( WFile = fopen( "Workout.inf", "r+" ) ) == NULL) //WORK OUT INFORMATION
DlgMessage("NOTICE", "File could not be opened", BT_OK,BT_NONE);
if( ( PData = fopen( "PData.dat", "r+") ) == NULL) // PROGRAM DATA
DlgMessage("NOTICE", "File could not be opened", BT_OK, BT_NONE);
newDay(WFile, index, &WorkOut);
ClrScr();
DisplaySchedule();
/// input checker
int i = 0;
while(input[i] = ngetchx() != 34)
{
switch (input[i]){
case 338:
if(i == 0)
{
if(pos - 2 > 0)
pos -= 2;
break;
}
else
{
DecisionInput(input, &WorkOut , pos);
if(pos - 2 > 0)
pos -= 2;
break;
}
case 340:
if(i == 0)
{
if(pos == 1)
{
}
else
{
if(pos + 1 < 10)
pos++;
break;
}
}
else
{
DecisionInput(input, &WorkOut , pos);
if(pos + 1 < 10)
pos++;
break;
}
case 344:
if(i == 0)
{
if(pos + 2 < 10)
pos += 2;
break;
}
else
{
DecisionInput(input, &WorkOut , pos);
if(pos + 2 > 0)
pos += 2;
break;
}
case 337:
if(i == 0)
{
if(pos - 1 > 0)
pos--;
break;
}
else
{
DecisionInput(input, &WorkOut , pos);
if(pos - 1 > 0)
pos--;
break;
}
case 13:
if(i == 0)
{
break;
}
else
{
DecisionInput(input, &WorkOut , pos);
if(pos + 1 < 10)
pos ++;
break;
}
}
}
// Place your code here.
}