Browse Source

Code cleaning

Yann Weber 8 years ago
parent
commit
39791c26a2
2 changed files with 2 additions and 29 deletions
  1. 1
    1
      AUTHORS
  2. 1
    28
      pybfenc.py

+ 1
- 1
AUTHORS View File

1
-Zered <zered@member.fsf.org>
1
+Yann Weber <yannweb@member.fsf.org>

+ 1
- 28
pybfenc.py View File

1
 #!/usr/bin/python
1
 #!/usr/bin/python
2
 
2
 
3
 #
3
 #
4
-#	Copyright 2014 Zered <zered@member.fsf.org>
4
+#	Copyright 2014 Yann Weber <yannweb@member.fsf.org>
5
 #
5
 #
6
 #	bfstr is free software: you can redistribute it and/or modify
6
 #	bfstr is free software: you can redistribute it and/or modify
7
 #	it under the terms of the GNU General Public License as published by
7
 #	it under the terms of the GNU General Public License as published by
62
 				plus = False
62
 				plus = False
63
 				delta*=-1
63
 				delta*=-1
64
 				
64
 				
65
-			"""
66
-			if delta > 1:
67
-				res+=nb2bf(delta,plus)
68
-			elif delta == 1:
69
-				if plus:
70
-					res+='+'
71
-				else:
72
-					res+='-'
73
-			"""
74
-			
75
 			if delta > OPTIDELTAMIN:
65
 			if delta > OPTIDELTAMIN:
76
 				res+=nb2bf(delta,plus)
66
 				res+=nb2bf(delta,plus)
77
 			elif delta > 0:
67
 			elif delta > 0:
107
 	primesP1 = primeFact(delta+1)
97
 	primesP1 = primeFact(delta+1)
108
 	primesM1 = primeFact(delta-1)
98
 	primesM1 = primeFact(delta-1)
109
 	
99
 	
110
-	"""
111
-	#print "delta",delta
112
-	primes = optiPrime(primeFact(delta))
113
-	#we will test if when adding or substracting 1 is not shorter
114
-	primesP1 = optiPrime(primeFact(delta+1))
115
-	primesM1 = optiPrime(primeFact(delta-1))
116
-	"""
117
-	
118
-	
119
 	p1 = False
100
 	p1 = False
120
 	m1 = False
101
 	m1 = False
121
 	
102
 	
188
 	nc = n
169
 	nc = n
189
 	
170
 	
190
 	res = []
171
 	res = []
191
-	"""
192
-	for i in PRIMES:
193
-		if nc == 0:
194
-			return res
195
-		while nc%i == 0:
196
-			res.append(i)
197
-			nc/=i
198
-	"""
199
 	for i in PRIMES:
172
 	for i in PRIMES:
200
 		if nc == 0:
173
 		if nc == 0:
201
 			return res
174
 			return res

Loading…
Cancel
Save