/* LabsLand starter for FPGAcademy Computer Organization, Lab 6, Part I.
 * Each nonempty list stores its element count in word zero.
 */
#include <stdio.h>

static int largest(const int *list)
{
    /* TODO: inspect the remaining data words and return the largest. */
    return list[1];
}

int main(void)
{
    const int mixed[] = {5, -12, 4, 17, -3, 5};
    const int negative[] = {4, -11, -7, -18, -7};
    printf("Mixed list maximum = %d\n", largest(mixed));
    printf("Negative list maximum = %d\n", largest(negative));
    fflush(stdout);
    return 0;
}
