Heat oven to 180°C (350°F). Melt the chocolate, coffee, rum or brandy, sugar and butter in a bowl sitting in a pot of simmering water. Remove from heat and stir until well mixed.
Add ground almonds and mix well. Beat in the egg yolks, one by one. Beat egg whites until stiff and peaky, and stir a couple of spoonfuls into the chocolate mixture to lighten it, before gently folding in the rest.
Turn into a buttered and floured 20 cm (8 in) round or square cake tin, and bake for 40 to 50 minutes.
Leave to cool before removing from tin and don’t worry if the crust falls and collapses. That’s perfectly normal, if not desirable. Dust with icing sugar to serve.