#!/usr/bin/env python

# normal
# Jim Bagrow
# Last Modified: 2011-04-06

import sys, os
from random import normalvariate

if __name__ == '__main__':
    
    # default args:
    mean = 0.0
    stdv = 1.0
    
    args = sys.argv[1:]
    if len(args) == 1: # assume only num_samples
        num_samples = int(sys.argv[1])
    elif len(args) == 2:
        mean = float(sys.argv[1])
        num_samples = int(sys.argv[2])
    elif len(args) == 3:
        mean = float(sys.argv[1])
        stdv = float(sys.argv[2])
        num_samples = int(sys.argv[3])
    else:
        sys.exit( "BAD USAGE: %s [mean] [stdv] number_of_samples" % (sys.argv[0]) )
    
    S = [normalvariate(mean, stdv) for x in xrange(num_samples)]
    
    sys.stdout.write("\n".join(map(str,S)))
    sys.stdout.flush() # necessary?
    

