diff harelet.c @ 4:0ed615367b10

Automated Vimcurial commmit
author VilyaemKenyaz
date Fri, 08 Sep 2023 08:16:07 -0400
parents eb7a7364994c
children 3879c1178448
line wrap: on
line diff
--- a/harelet.c	Fri Sep 08 08:02:33 2023 -0400
+++ b/harelet.c	Fri Sep 08 08:16:07 2023 -0400
@@ -6,7 +6,9 @@
 
 #include <stdio.h> 
 #include <stdlib.h>
+#include <string.h>
 #include "basedfilelib.h"
+#include "minibasediolib.h"
 
 #define DEEPNESS 5
 #define MAXPOINT 4096
@@ -17,7 +19,7 @@
 	unsigned int X,Y,down;
 }point;
 
-points[MAXPOINT];
+point points[MAXPOINT];
 
 unsigned int X,Y,step,down,numpoints;
 char action;
@@ -74,30 +76,32 @@
 	if(choice == 1){
 		//Set the miller
 		strcat(file,UNITS);
-		
+
 		//Meat of instructions
 		for(int i = 0;i != numpoints;i++){
-		//Compose
-		char * instruction;
-		strcat(instruction,"G0 X");
-		strcat(instruction,sprintf("%d",points[i].X));
-		strcat(instruction," Y");
-		strcat(inustrction,sprintf("%d",points[i].Y));
-		strcat(instructions," Z");
-		strcat(instructions,sprintf("%d",points[i].Z));
-		//Write to string
-		strcat(file,instruction);
+			//Compose
+			char * instruction;
+			strcat(instruction,"G0 X");
+			strcat(instruction,sprintf("%d",points[i].X));
+			strcat(instruction," Y");
+			strcat(instruction,sprintf("%d",points[i].Y));
+			strcat(instruction," Z");
+			strcat(instruction,sprintf("%d",DEEPNESS));
+			//Write to string
+			strcat(file,instruction);
 		}
 		//Finish
 		strcat(file,"G0, X0, Y0, Z0");
 		WriteFile(filename,file);
 	}
 	else{
+		puts("Superhare implementation not done");
+		exit(1);
 		//Set the miller
-		
+
 
 		//Meat of instructions
-	
+
 
 		//Finish
 
@@ -138,6 +142,9 @@
 					puts("Enter new step:");
 					scanf("%d",&step);
 					break;
+
+		case 'c':		Compile();
+					break;
 		default:
 					break;
 	}