Have you ever wanted to make a program that sorts words in a dictionary? Or how about just seeing which word greater in the alphabetic order? Well luckily for you, Turing has a built-in feature that allows you to do such tasks with minimal effort! In fact, it's the same as comparing real numbers. However, please keep in mind that Turing compares each character's Ascii codes, not by their actual order. For instance, consider the following comparisons:
The similarity with comparing numbers still continues when dealing with character strings. Just like comparing two 2-digit numbers, Turing looks for the greater first character. If that's the same, then it compared the second character and so on. The following is a second example:
Example 2 “Apple” < “Arial” This makes sense, as Arial comes after Apple in alphabetical order. As you may recall, a space is also an Ascii character with the code “32”. Example 3 shows it's important. Example 3 “AAA” < “AAA ”