#!/bin/bash

MILLION='000000'

# Build the C program - everyone gets the same thing!

cc -o sortdemo sortdemo.c
cc -o randomizedsample randomizedsample.c

# Fugly but portable:
for nIteration in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
  ./randomizedsample "$nIteration$MILLION" > sample.txt
  ./sortdemo "$nIteration$MILLION" < sample.txt >> test.txt
  echo "" >> test.txt
  rm -f sample.txt
done

