comparison harelet.c @ 10:c73aed540bdd

Automated Vimcurial commmit
author VilyaemKenyaz
date Tue, 12 Sep 2023 07:17:22 -0400
parents 4eb02dffc00f
children 1d4df12de9e3
comparison
equal deleted inserted replaced
9:4eb02dffc00f 10:c73aed540bdd
44 * Author - William King 44 * Author - William King
45 * Date - Sep 08 2023 45 * Date - Sep 08 2023
46 * *******************************************/ 46 * *******************************************/
47 void Render(){ 47 void Render(){
48 clrscr(); 48 clrscr();
49 gotoxy(0,30); 49 gotoxy(0,3);
50 puts("HARELET A CAD PROGRAM BY VILYAEM KENYAZ, PEEP SOFTWARE 2023"); 50 puts("HARELET A CAD PROGRAM BY VILYAEM KENYAZ, PEEP SOFTWARE 2023");
51 printf("Number of Points: %d X: %d Y: %d STEPSIZE: %d DWN?: %d\n",numpoints,X,Y,step,down); 51 printf("Number of Points: %d X: %d Y: %d STEPSIZE: %d DWN?: %d\n",numpoints,X,Y,step,down);
52 52
53 //Render points 53 //Render points
54 for(int i = 0;i != MAXPOINT;i++){ 54 for(int i = 0;i != MAXPOINT;i++){
72 //Render cursor 72 //Render cursor
73 73
74 gotoxy(X,Y); 74 gotoxy(X,Y);
75 75
76 puts("&"); 76 puts("&");
77
78 //Move cursor to top of document, so its not trailing the cadcursor
79 gotoxy(0,0);
77 80
78 81
79 82
80 } 83 }
81 84
136 * *******************************************/ 139 * *******************************************/
137 void main(int argc, char* argv[]){ 140 void main(int argc, char* argv[]){
138 clrscr(); 141 clrscr();
139 while(1){ 142 while(1){
140 Render(); 143 Render();
141 /*
142 scanf("%c",&action);
143 switch(action){
144 case 'a':
145 points[numpoints].X = X;
146 points[numpoints].Y = Y;
147 points[numpoints].down = down;
148 numpoints++;
149 break;
150 case 'h':
151
152 X += step;
153 break;
154 case 'j':
155 Y += step;
156 break;
157 case 'k':
158 Y -= step;
159 break;
160 case 'l':
161 X -= step;
162 break;
163 case 's':
164 puts("Enter new step:");
165 scanf("%d",&step);
166 break;
167
168 case 'c': Compile();
169 break;
170 default:
171 break;
172 }
173 */
174
175 //New CONIO controls 144 //New CONIO controls
176 switch(getchar()){ 145 switch(getchar()){
177 case 'h': 146 case 'h':
178 X += step; 147 X += step;
179 break; 148 break;
197 points[numpoints].X = X; 166 points[numpoints].X = X;
198 points[numpoints].Y = Y; 167 points[numpoints].Y = Y;
199 points[numpoints].down = down; 168 points[numpoints].down = down;
200 numpoints++; 169 numpoints++;
201 break; 170 break;
171 case 'd':
172 if(down == 1){
173 down = 0;
174 }
175 else{
176 down = 1;
177 }
178 break;
202 179
203 case 'c': 180 case 'c':
204 Compile(); 181 Compile();
205 break; 182 break;
206 183