This is a fairly simple code golf challenge. Your program, given an ASCII string, is to parse that string into two strings, which it will evaluate. If the second string is "later" than the first one, it will return a 1, if it is "earlier" than the first one, it will return a -1, and if they are the same, it will return 0. To clarify what "later" and "earlier" mean, let's take a look at ASCII character codes. You need to compare each character of the string, treating each of them as digits of a number. Later refers to a larger number, occurring after a smaller number. Strings will be formatted with a hyphen character to separate the two input groups.
Take a look at this example:
7-9as an input should return
7converts to ASCII code
9converts to ASCII code
57occurs numerically after
9is later than
LKzb-LKajas an input should return
The ASCII code sequences for this are
This is a code golf challenge, and byte count is how entries will be scored.
Any input from the 95 printable ASCII characters is accepted, excluding spaces, and hyphens for anything but separating the input. In addition, strings are not guaranteed to be the same length.
EDIT: To be more clear, each character is to be treated like a digit in a number. In the example
j is later than
z is later than
a, and since it is a more significant digit, it takes precedence. A string supplied will always be at minimum 3 characters, eliminating empty strings from the scope of this problem.
EDIT: Here are some more test cases, for your help: