#!/usr/bin/env python3 import argparse import random from lib import * parser = argparse.ArgumentParser(description='Generate a test case with one word for each length from 1 to n.') parser.add_argument('-n', dest='n', type=int, help='the number of words') parser.add_argument('-w', dest='w', type=int, help='the width of the test case') parser.add_argument('-sort', dest='sort', type=str, choices=['asc', 'desc', 'rand']) args = parser.parse_args() random.seed(args.n*args.w) ks = list(range(1,args.n+1)) if args.sort == 'desc': ks = ks[::-1] if args.sort == 'rand': random.shuffle(ks) words = random_from_lengths(ks) print(args.n, args.w) print('\n'.join(words))