Contests


Programming Contest 4 - Alphabetizer
Begins: 12.31.00
Ends: 1.13.01

    Problem:

    The goal of this contest is to alphabetize word strings in a zero-terminated list (LIST). For the sake of simplicity, each string will be exactly 16 bytes. The unused bytes at the end of a small word string are filled with blank (" ") spaces.

    Standard alphabetizing rules apply. A blank space is considered the lowest character, followed by the numbers (0-9) in ascending order, followed by the uppercase alphabet (A-Z) in ascending order, followed by the lowercase alphabet (a-z) in ascending order.

    Send your entries to Sam by January 13th. Good luck!

    Directions:

    Optimization: SIZE

    Input:
    A zero-terminated list of word strings at address LIST
      LIST:
      .db "Void Productions"
      .db "Sam Heald          "
      .db "Harper Maddox  "
      .db "Kouri Rosenberg "
      .db "Ahmed E             "
      .db "Wouter D            "
      .db "Derrick Ward      ",0
    Output:
    An alphabetized zero-terminated list of word strings at address LIST
      LIST:
      .db "Ahmed E             "
      .db "Derrick Ward      "
      .db "Harper Maddox  "
      .db "Kouri Rosenberg "
      .db "Sam Heald          "
      .db "Wouter D            "
      .db "Void Productions",0

    Constraints:

    1.)Space, 0-9, A-Z, and a-z are the only characters with which your routine has to concern itself.
    2.)Space will not be the first character of a word string.
    3.)You may assume that interrupts are disabled (shadow registers are ok).
    4.)You may not use ROM calls.
    5.)Any temporary memory counts towards your byte total.
    6.)Self-mod code may be used as long as it does not corrupt the routine. The routine must be able to execute multiple times.
    7.)LIST can contain between 1 and an infinite number of word strings.