comparison harelet.c @ 9:4eb02dffc00f

Automated Vimcurial commmit
author VilyaemKenyaz
date Tue, 12 Sep 2023 07:02:31 -0400
parents c60e4315cb7e
children c73aed540bdd
comparison
equal deleted inserted replaced
8:c60e4315cb7e 9:4eb02dffc00f
55 gotoxy(0,50); 55 gotoxy(0,50);
56 56
57 gotoxy(points[i].X,points[i].Y); 57 gotoxy(points[i].X,points[i].Y);
58 58
59 if(points[i].down == 0){ 59 if(points[i].down == 0){
60 puts("X"); 60 //puts("X");
61 printf("X");
61 } 62 }
62 else{ 63 else{
63 puts("*"); 64
65 //puts("*");
66 printf("*");
64 } 67 }
65 68
66 69
67 } 70 }
68 71
80 * Description - This function compiles instructions for CNC machines. 83 * Description - This function compiles instructions for CNC machines.
81 * Author - William King 84 * Author - William King
82 * Date - Sep 08 2023 85 * Date - Sep 08 2023
83 * *******************************************/ 86 * *******************************************/
84 void Compile(){ 87 void Compile(){
88 /*
85 char * filename; 89 char * filename;
86 char * file; 90 char * file;
87 char buffer[sizeof(int)*8+1]; 91 char buffer[sizeof(int)*8+1];
88 int choice; 92 int choice;
89 93
119 WriteFile(filename,file); 123 WriteFile(filename,file);
120 } 124 }
121 125
122 puts("Finished Compiling"); 126 puts("Finished Compiling");
123 127
128 */
124 } 129 }
125 130
126 131
127 /********************************************* 132 /*********************************************
128 * Description - Main function 133 * Description - Main function
129 * Author - William King 134 * Author - William King
130 * Date - Sep 08 2023 135 * Date - Sep 08 2023
131 * *******************************************/ 136 * *******************************************/
132 void main(int argc, char* argv[]){ 137 void main(int argc, char* argv[]){
138 clrscr();
133 while(1){ 139 while(1){
134 Render(); 140 Render();
135 scanf("%c",&action); 141 /*
136 switch(action){ 142 scanf("%c",&action);
137 case 'a': points[numpoints].X = X; 143 switch(action){
138 points[numpoints].Y = Y; 144 case 'a':
139 points[numpoints].down = down; 145 points[numpoints].X = X;
140 numpoints++; 146 points[numpoints].Y = Y;
141 break; 147 points[numpoints].down = down;
142 case 'h': 148 numpoints++;
143 149 break;
144 X += step; 150 case 'h':
145 break; 151
146 case 'j': 152 X += step;
147 Y += step; 153 break;
148 break; 154 case 'j':
149 case 'k': 155 Y += step;
150 Y -= step; 156 break;
151 break; 157 case 'k':
152 case 'l': 158 Y -= step;
153 X -= step; 159 break;
154 break; 160 case 'l':
155 case 's': 161 X -= step;
156 puts("Enter new step:"); 162 break;
157 scanf("%d",&step); 163 case 's':
158 break; 164 puts("Enter new step:");
159 165 scanf("%d",&step);
160 case 'c': Compile(); 166 break;
161 break; 167
162 default: 168 case 'c': Compile();
163 break; 169 break;
170 default:
171 break;
172 }
173 */
174
175 //New CONIO controls
176 switch(getchar()){
177 case 'h':
178 X += step;
179 break;
180 case 'j':
181 Y += step;
182 break;
183 case 'k':
184 Y -= step;
185 break;
186 case 'l':
187 X -= step;
188 break;
189
190 case 's':
191 puts("New stepsize");
192 scanf("%d",&step);
193
194 break;
195
196 case 'a':
197 points[numpoints].X = X;
198 points[numpoints].Y = Y;
199 points[numpoints].down = down;
200 numpoints++;
201 break;
202
203 case 'c':
204 Compile();
205 break;
206
207 default:
208 putchar('\a');
209 break;
164 } 210 }
165 } 211 }
166 212
167 exit(0); 213 exit(0);
168 } 214 }