Created
January 12, 2011 03:37
-
-
Save hlian/775653 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import random | |
import sys | |
print(1000) | |
def randfloat(a, b): | |
return random.random() * (b - a) + a | |
for i in xrange(int(sys.argv[1])): | |
x = random.randint(-1000, 1000) | |
y = random.randint(-1000, 1000) | |
z = random.randint(-1000, 1000) | |
vx = randfloat(1e4, 1e10) | |
vy = randfloat(1e4, 1e10) | |
vz = randfloat(1e4, 1e10) | |
mass = randfloat(1e20, 1e30) | |
print('%.4g %.4g %.4g %.4g %.4g %.4g %.4g' % (x, y, z, vx, vy, vz, mass)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment