[Icarus Productions] - Click for main page The team Projects Articles Features
The list of the winners of the contest which ended 03/28/99:

Place Name Scores Sum
1. Dux Gregis & Tim Adkisson 23 + 25 + 20 68
2. Aaron Curtis 23 + 25 + 21 69
3. Kirk Meyer 23 + 25 + 21 69
4. Ian Collier 27 + 26 + 21 74
5. Jonah Cohen 25 + 26 + 23 74
6. Alvin Albrecht 27 + 26 + 21 74
7. Jeff Hellrung 23 + 32 + 21 76
8. Dmitry Semyonov 36 + 39 + 29 104
-- David Philips 25 + -- + -- --

This ZIP contains all the solutions sent in. Be aware of the fact that some may not work! These were the problems to be solved:

Optimization: Size

Abbreviations:

    Z-string = null-terminated string
    ZF = zero flag set
    NZ = zero flag cleared
    CF = carry flag set
    NC = carry flag cleared
Unless otherwise specified, all strings are Z-strings.

Problem 1

Reverse the bits in a string of bytes

Input:HL string of bits, A = length of substring (0 < A < 256)
Output:The bits in the string should be reversed
Special:You may use 256 bytes of temporary storage, starting at TEMP

Example:

Input:HL = $C000, A = 5
($C000)=%10010111
($C001)=%00011011
($C002)=%10101111
($C003)=%00011001
($C004)=%11010010
Output:($C000)=%01001011
($C001)=%10011000
($C002)=%11110101
($C003)=%11011000
($C004)=%11101001

Problem 2

Decide whether a Z-string is a palindrome or not (A palindrome is a number, word or phrase that reads the same backwards as forwards).

Input:HL string
Output:Return with zeroflag set if the string is a palindrome, else the flag should be cleared
Special:You mayy assume that the string will only contain the lowercase letters a-z and word spacing. Note that white spaces should be discarded!!!

Examples:

Input:HL "rise to vote sir",0
Output:ZF

Input:HL "abcdcb",0
Output:NZ

Don't forget to check special cases, like a string of size 0 (which should be considered as a palindrome).

Problem 3

Search for a substring in a string (case-sensitive).

Input:HL string, DE substring
Output:If the substring exists, the carry flag should be cleared, and HL point to the first position in the string where the substring occurs.
If the substring doesn't exist, the carry flag should be set, and HL may be anything.
Special:You may assume that the substring has at least 1 byte. The string itself can be of length 0 though.

Examples:

Input:HL "This is a string!!",0
DE "ring",0
Output:NC, HL "ring!!",0

Input:HL "Another string!!",0
DE "another",0
Output:CF

 
 
Page last updated on Sun Apr 25 23:57:46 1999 E-mail us!Top of page