You are not logged in.
Dear visitor, welcome to Aqua Computer Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
Source code |
1 2 3 4 5 6 7 8 |
######## ######## ######## ######## ######## ######## ######## ######## |
|
|
Source code |
1 2 3 4 |
##y# xx?y ##x# ##x# |
|
|
Source code |
1 2 3 4 |
##1# 11?# ##1# ##1# |

.This post has been edited 10 times, last edit by "Quutamo" (Jun 1st 2009, 8:58am)

|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 |
def search(self, lx, ly):
m = self.data
for y in range(2, len(m)-2)[::-1]:
for x in range(2, len(m[0])-2)[::-1]:
a = m[y + lx[0][1]][x + lx[0][0]]
vy = [m[y + j][x + i] for i, j in ly]
if (all(a == m[y + j][x + i] for i, j in lx[1:]) and (a in vy)):
sw = map(operator.add, (x, y), ly[vy.index(a)])
ds = ['0','z']
if m[y][x] not in ds and m[sw[1]][sw[0]] not in ds:
return (x-2, y-2),map(operator.sub, tuple(sw), (2,2))
|
. So etwas fasziniert mich einfach und da ich alles was ich nicht niederschreibe nach paar tagen schon wieder vergessen habe dachte ich poste es auch gleich hier. So lange es funktioniert und das Ergbnis in akzeptabler Zeit vorhanden ist, wer will da mehr?
Ich kann dazu nicht viel sagen, weil python schon verdammt lange her ist das ich etwas(wenn man "hello world" überhaupt so nennen kann) damit gemacht habe.`xrange()`! Denkt denn niemand an die Kinderden Speicher?!![]()
-