#!/usr/local/bin/cz -- use b def usage(): usage("n_typs width curve0 curve1 gridtype") Main: int n_typs, w num curve0, curve1 int gridtype = 0 Getargs(int, n_typs, w) Getargs(num, curve0) curve1 = curve0 getargs(num, curve1) getargs(int, gridtype) sf("%d %d %lf %lf", w*w, 300 / (w+1), curve0, curve1) num r = (w-1)/2.0 int odd = 0 for(x, 0.0, w-.1): odd ^= 1 num offset = gridtype && odd ? 1/sqrt(3) : 0.0 for(y, offset, w+offset-.1): num tx = x, ty = y if gridtype == 2: x = Rand(0, w-1) y = Rand(0, w-1) sf("%f %f %d", x-r, y-r, randi(n_typs)) x = tx ; y = ty