summaryrefslogtreecommitdiff
path: root/scripts/mapgen.py
blob: fc8995867ae40fd15117743dbbcbbc1e66866fc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from random import randint

high = [' ',',','.',':',';']
low = ['O','0']

x = int(raw_input("width"))
y = int(raw_input("height"))

f = open("map.txt","w+")

for i in range(y):
    for j in range(x):
        k = randint(1,50)
        if k == 1:
            f.write(low[randint(0,len(low)-1)])
        else:
            f.write(high[randint(0,len(high)-1)])
    f.write('\n')

f.close()