Skip to content
Snippets Groups Projects
Commit b628079c authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Sorting and printing order changed

Sorting now occurs when getting a char
Data is now sent in ascending order
parent 73b922a9
No related branches found
No related tags found
No related merge requests found
...@@ -84,6 +84,7 @@ int main(){ ...@@ -84,6 +84,7 @@ int main(){
v[i] = n; v[i] = n;
n = 0; n = 0;
i++; i++;
insertionSort(v,i);
}else{ }else{
h = ctoi(c); h = ctoi(c);
if(h != EOF) { if(h != EOF) {
...@@ -94,10 +95,10 @@ int main(){ ...@@ -94,10 +95,10 @@ int main(){
} }
} }
insertionSort(v,i);
char hex[9]; char hex[9];
for(;i>0;i--){ int count;
itoc(v[i-1], hex); for(count = 0; count < i; count++){
itoc(v[count], hex);
n = 0; n = 0;
while(hex[n] != '\0') { while(hex[n] != '\0') {
Putc(hex[n]); Putc(hex[n]);
...@@ -110,7 +111,6 @@ int main(){ ...@@ -110,7 +111,6 @@ int main(){
writeFirstChar(); writeFirstChar();
} }
int count;
for(count=0;count<1000;count++); //Wait for the remote uart for(count=0;count<1000;count++); //Wait for the remote uart
return 0; return 0;
...@@ -239,4 +239,4 @@ void itoc(int n, char* result) { ...@@ -239,4 +239,4 @@ void itoc(int n, char* result) {
j = 1; j = 1;
} }
result[j] = '\0'; result[j] = '\0';
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment