def test_coluna_do_seis(self):
     coluna = Espiral.achar_coluna(3,6)
     self.assertEqual(2,coluna)
Esempio n. 2
0
graphicsDFS.printCovertura(coverturaDFS)
(visit,revisit) = graphicsDFS.counter()
twist = graphicsDFS.numberOfTwist(coverturaDFS)
with open ("propiedesDfs.txt","wb") as f:
        f.write("visitas: {visitas} re visitas : {revisitas} giros {giros}".format(visitas = visit,revisitas=revisit, giros = twist))


coverturaPixelsDFS = openCvScript.getCentralPixel(coverturaDFS)
np.savetxt("coverturaDFS.txt",coverturaPixelsDFS,delimiter=',')
with open("coverturaDFS.txt","wb") as f:
        writer = csv.writer(f)
        writer.writerows(coverturaPixelsDFS)

matrizFromImageForEspiral = c3
g = copy.deepcopy(matrizFromImageForEspiral)
espiral = Espiral()
coverturaEspiral = espiral.getCoverturePath(matrizFromImageForEspiral,inicio[0],inicio[1])
coverturaEspiralPixels = openCvScript.getCentralPixel(coverturaEspiral)
graphicsCovertura = Graphics(g)
graphicsCovertura.printCovertura(coverturaEspiral)
(visit,revisit) = graphicsCovertura.counter()
twist = graphicsCovertura.numberOfTwist(coverturaEspiral)

with open ("propiedaesCovertura.txt","wb") as f:
        f.write("visitas: {visitas} re visitas : {revisitas} giros {giros}".format(visitas = visit,revisitas=revisit, giros = twist))
        
        
np.savetxt("coverturaEspiral.txt",coverturaEspiralPixels,delimiter = ",")
with open("coverturaEspiral.txt","wb") as f:
        writer = csv.writer(f)
        writer.writerows(coverturaEspiralPixels)
 def test_linha_do_dois(self):
     linha = Espiral.achar_linha(3,2)
     self.assertEqual(3,linha)
 def test_coluna_do_oito(self):
     coluna = Espiral.achar_coluna(3,8)
     self.assertEqual(3,coluna)
 def test_linha_do_um(self):
     linha = Espiral.achar_linha(3,1)
     self.assertEqual(2,linha)
 def test_linha_do_seis(self):
     linha = Espiral.achar_linha(3,6)
     self.assertEqual(1,linha)
 def test_linha_do_cinco(self):
     linha = Espiral.achar_linha(3,5)
     self.assertEqual(1,linha)
 def test_linha_do_quatro(self):
     linha = Espiral.achar_linha(3,4)
     self.assertEqual(2,linha)
 def test_linha_do_nove(self):
     linha = Espiral.achar_linha(3,9)
     self.assertEqual(3,linha)
 def test_linha_do_oito(self):
     linha = Espiral.achar_linha(3,8)
     self.assertEqual(2,linha)
Esempio n. 11
0
print("dimensiones de la matriz")

hm,gm = input()
mapa = np.zeros((hm,gm))
mv = matricesVacias(hm,gm)
a = mv.matrizForSunshine()
b = copy.deepcopy(a)


##mapa = np.array([[0,0,0,0,-1], \
##                 [0,0,0,0,-1], \
##                 [0,0,0,-1,-1], \
##                 [-1,-1,-1,-1,-1] ])

hm,gm = mapa.shape
print(hm,gm)
print(a)
print("posicion Inicial ")
pi_x = int(input())
pi_y = int(input())
espiral = Espiral()
covertura = espiral.getCoverturePath(a,pi_x,pi_y)
graphis = Graphics(b)
graphis.printCovertura(covertura)


##print("anterior")
##ps_x = int(input())
##ps_y = int(input())