-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExperiments.py
39 lines (35 loc) · 950 Bytes
/
Experiments.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
__author__ = 'martin'
import PicrossAlgorithms as PA
def Incrementer(number,base,len):
#print "IncCall w/ :%s,%s,%s" %(number,base,len)
val=[]
for i in range(int(number)):
#print "inc rout nr %s"%i
lis=BaseConversion(i,base,len)
if lis==sorted(lis):
val.append(lis)
return val
def BaseConversion(number,base,len):
if base == 0:
return [0 for i in range(len)]
elif base == 1:
print "Enter"
stor=[]
for i in range(number):
stor.append(1)
while stor.__len__()<len:
stor.append(0)
stor.reverse()
return stor
else:
flag=False
stor = []
while flag!=True:
stor.append(number%base)
number=int(number/base)
if number<1:
flag=True
while stor.__len__()<len:
stor.append(0)
stor.reverse()
return stor