diff harelet.c @ 9:4eb02dffc00f

Automated Vimcurial commmit
author VilyaemKenyaz
date Tue, 12 Sep 2023 07:02:31 -0400
parents c60e4315cb7e
children c73aed540bdd
line wrap: on
line diff
--- a/harelet.c	Tue Sep 12 06:46:45 2023 -0400
+++ b/harelet.c	Tue Sep 12 07:02:31 2023 -0400
@@ -57,10 +57,13 @@
 		gotoxy(points[i].X,points[i].Y);
 
 		if(points[i].down == 0){
-			puts("X");
+			//puts("X");
+			printf("X");
 		}
 		else{
-			puts("*");
+
+			//puts("*");
+			printf("*");
 		}
 
 
@@ -82,6 +85,7 @@
  * Date - Sep 08 2023
  * *******************************************/
 void Compile(){
+	/*
 	char * filename;
 	char * file;
 	char buffer[sizeof(int)*8+1];
@@ -121,6 +125,7 @@
 
 	puts("Finished Compiling");
 
+	*/
 }
 
 
@@ -130,37 +135,78 @@
  * Date - Sep 08 2023
  * *******************************************/
 void main(int argc, char* argv[]){
+	clrscr();
 	while(1){
 		Render();
-		scanf("%c",&action);
-		switch(action){
-			case 'a':		points[numpoints].X = X;
-						points[numpoints].Y = Y;
-						points[numpoints].down = down;
-						numpoints++;
-						break;
-			case 'h': 
+		/*
+		   scanf("%c",&action);
+		   switch(action){
+		   case 'a':
+		   points[numpoints].X = X;
+		   points[numpoints].Y = Y;
+		   points[numpoints].down = down;
+		   numpoints++;
+		   break;
+		   case 'h': 
+
+		   X += step;
+		   break;
+		   case 'j': 
+		   Y += step;
+		   break;
+		   case 'k': 
+		   Y -= step;
+		   break;
+		   case 'l': 
+		   X -= step;
+		   break;
+		   case 's':		
+		   puts("Enter new step:");
+		   scanf("%d",&step);
+		   break;
+
+		   case 'c':		Compile();
+		   break;
+		   default:
+		   break;
+		   }
+		   */
 
-						X += step;
-						break;
-			case 'j': 
-						Y += step;
-						break;
-			case 'k': 
-						Y -= step;
-						break;
-			case 'l': 
-						X -= step;
-						break;
-			case 's':		
-						puts("Enter new step:");
-						scanf("%d",&step);
-						break;
+		//New CONIO controls
+		switch(getchar()){
+		case 'h': 
+			X += step;
+			break;
+		case 'j': 
+			Y += step;
+			break;
+		case 'k': 
+			Y -= step;
+			break;
+		case 'l': 
+			X -= step;
+			break;
 
-			case 'c':		Compile();
-						break;
-			default:
-						break;
+		case 's': 
+			puts("New stepsize");
+			scanf("%d",&step);
+
+			break;
+
+		case 'a': 
+		   	points[numpoints].X = X;
+		   	points[numpoints].Y = Y;
+		   	points[numpoints].down = down;
+		   	numpoints++;
+			break;
+
+		case 'c': 
+			Compile();
+			break;
+
+		default:
+			putchar('\a');
+			break;
 		}
 	}