#!/usr/bin/env python
#
# Draft version for  isort.py
#
#  Name:  John Johnson  <MeMe@SababaMail.moc>
#  Date:  2099/Pentember/33

import sys

def ilist_show(a):
    # Put here the code
    sys.stdout.write("ilist_show: Sorry - not done yet...\n")


# Sort a list of integers
def isort(a):
    tb = 0 # tail begin
    while tb < len(a):

        # Find the minimum position in the tail  a[tb ...]
        imin = tb  # 1st guess, minimum at the beginning of the tail
        j = tb + 1
        while j < len(a):
            # if a[j] is smaller, then update imin
            pass # Delete this line

        # Swap:  a[tb] <-> a[imin]
        # ...

        tb += 1
    return a

# Program begin
if len(sys.argv) == 1:
    sys.stderr.write("Usage: %s <numbers...>\n" % sys.argv[0])
    sys.exit(0)


# Get integers from command line
nums = [] # Start with empty list
ai = 1    # After program name
while ai < len(sys.argv):
    n = int(sys.argv[ai])
    # add n to the list
    ai += 1

sys.stdout.write("Before sort: ")
ilist_show(nums)

sorted = isort(nums)

sys.stdout.write("After sort:  ")
ilist_show(sorted)

sys.exit(0)



