Skip to main content
reduced 20 bytes
Source Link

C++ , 210210 190 bytes

My First Try At Golfing !

#include<iostream>
int g(char*a){char k,j,d;std::cout<<*a;a++;for(;*a;a++){for(j=*(a-1),d=j-*a,k=d>0?d>13?62:60:d<-13?60:62;j!=*a;j+=d>0?d>13?1:-1:d<-13?=*a;j+=k-1:161,j=j<97?122:j>122?97:j)std::cout<<k;std::cout<<'*';}}

k stores which of < , > or * to print .At first it simply prints the first element of array then runs a loop for a from first to last element of array . j stores the previous element and then by comparing if j closer to *a by < or > set k to < ,> respectively and then print k then run this loop until j becomes equal to p . Then after every ending of second loop print * .

C++ , 210 bytes

My First Try At Golfing !

#include<iostream>
int g(char*a){char k,j,d;std::cout<<*a;a++;for(;*a;a++){for(j=*(a-1),d=j-*a,k=d>0?d>13?62:60:d<-13?60:62;j!=*a;j+=d>0?d>13?1:-1:d<-13?-1:1,j=j<97?122:j>122?97:j)std::cout<<k;std::cout<<'*';}}

k stores which of < , > or * to print .At first it simply prints the first element of array then runs a loop for a from first to last element of array . j stores the previous element and then by comparing if j closer to *a by < or > set k to < ,> respectively and then print k then run this loop until j becomes equal to p . Then after every ending of second loop print * .

C++ ,210 190 bytes

My First Try At Golfing !

#include<iostream>
int g(char*a){char k,j,d;std::cout<<*a;a++;for(;*a;a++){for(j=*(a-1),d=j-*a,k=d>0?d>13?62:60:d<-13?60:62;j!=*a;j+=k-61,j=j<97?122:j>122?97:j)std::cout<<k;std::cout<<'*';}}

k stores which of < , > or * to print .At first it simply prints the first element of array then runs a loop for a from first to last element of array . j stores the previous element and then by comparing if j closer to *a by < or > set k to < ,> respectively and then print k then run this loop until j becomes equal to p . Then after every ending of second loop print * .

corrected the answer
Source Link

C++ , 132210 bytes

My First Try At Golfing !

#include<iostream>
int g(char *achar*a){char k,*p=a;cout<<*p;p++;forj,d;std::cout<<*a;a++;for(int j;*p!=0;p++;*a;a++){for(j=*(pa-1),k=jd=j-*p>0*a,k=d>0?'<'d>13?62:'>';j60:d<-13?60:62;j!=*p;j+=j=*a;j+=d>0?d>13?1:-*p>01:d<-13?-1:1,j=j<97?122:j>122?97:j)cout<<k;cout<<'*';std::cout<<k;std::cout<<'*';}}

k stores which of < , > or * to print , p is a pointer to n the element of array   .At first it simply prints the first element of array then runs a loop for pa from first to last element of array . j stores the previous element and then by comparing if j is greater than pcloser to *a by < or > set k to < else to >,> respectively and then print k then run this loop until j becomes equal to p . Then after every ending of second loop print * .

C++ , 132 bytes

My First Try At Golfing !

int g(char *a){char k,*p=a;cout<<*p;p++;for(int j;*p!=0;p++){for(j=*(p-1),k=j-*p>0?'<':'>';j!=*p;j+=j-*p>0?-1:1)cout<<k;cout<<'*';}}

k stores which of < , > or * to print , p is a pointer to n the element of array .At first it simply prints the first element of array then runs a loop for p from first to last element of array . j stores the previous element and then by comparing if j is greater than p set k to < else to > and then print k then run this loop until j becomes equal to p . Then after every ending of second loop print * .

C++ , 210 bytes

My First Try At Golfing !

#include<iostream>
int g(char*a){char k,j,d;std::cout<<*a;a++;for(;*a;a++){for(j=*(a-1),d=j-*a,k=d>0?d>13?62:60:d<-13?60:62;j!=*a;j+=d>0?d>13?1:-1:d<-13?-1:1,j=j<97?122:j>122?97:j)std::cout<<k;std::cout<<'*';}}

k stores which of < , > or * to print   .At first it simply prints the first element of array then runs a loop for a from first to last element of array . j stores the previous element and then by comparing if j closer to *a by < or > set k to < ,> respectively and then print k then run this loop until j becomes equal to p . Then after every ending of second loop print * .

Source Link

C++ , 132 bytes

My First Try At Golfing !

int g(char *a){char k,*p=a;cout<<*p;p++;for(int j;*p!=0;p++){for(j=*(p-1),k=j-*p>0?'<':'>';j!=*p;j+=j-*p>0?-1:1)cout<<k;cout<<'*';}}

k stores which of < , > or * to print , p is a pointer to n the element of array .At first it simply prints the first element of array then runs a loop for p from first to last element of array . j stores the previous element and then by comparing if j is greater than p set k to < else to > and then print k then run this loop until j becomes equal to p . Then after every ending of second loop print * .