Of course, these casemates (this word referring specifically to the complex of underground passages - the Bock is the rocky promontory they are built into) did serve a historical purpose, which was to defend the city. The "windows" are almost certainly intended for cannon fire.