RosettaCodeData/Task/Constrained-random-points-o.../Python/constrained-random-points-o...

39 lines
1.0 KiB
Python

>>> for i in range(1000): world[choice(possiblepoints)] += 1
>>> for x in range(-15,16):
print(''.join(str(min([9, world[(x,y)]])) if world[(x,y)] else ' '
for y in range(-15,16)))
2
41341421333
5133333131253 1
5231514 14214721 24
326 21222143234122322
54235153132123344125 22
32331432 2422 33
5453135 4144344
132595 323123
4 6353 432224
5 4323 3 5313
23214 41433
42454 33342
332 4 34314
142 1 35 53
124211 53131
22221 152 4
22213 34562
654 4 4 212
24354 52232
544222 283323
411123 453325
251321 124332
2124134 2443226
2 113315 64324334
2412452 324 32121132363
4222434324635 5433
3113333123432112633
2131181233 424
47414232164
4