Beispiel #1
0
    def CheckMapInfo(self, x, y):
        from DbClass import Dbclass
        db = Dbclass()
        db.Connect()
        Used = db.GetMapInfo(x, y)

        return Used
    def ShootBoatAI(self):
        from DbClass import Dbclass
        db = Dbclass()

        coord = [random.randrange(0, 8), random.randrange(0, 8)]
        used = db.GetMapInfo(coord[0], coord[1])

        if used == 0:
            db.Connect()
            db.SetHitOnMapAI(coord[0], coord[1])
    def SetBoatOnMap(self, boatLength):
        from DbClass import Dbclass
        db = Dbclass()
        coord = [random.randrange(0, 8), random.randrange(0, 8)]

        for l in range(boatLength):
            db.Connect()
            used = db.GetMapInfo(coord[0] + l, coord[1])

            if used == 0:
                db.Connect()
                db.SetBoatOnMapAI(coord[0] + l, coord[1])
	def CheckMapInfo(self, x, y):
		db = Dbclass()
		Used = db.GetMapInfo(x, y)

		return Used