Today preparations for a hangi take place, while I try to get to grips with some deeply nested code, before finishing off an enjoyable evening with some board games.

Preparations for a hangi

At the community centre today it has been quite busy compared with your usual Friday.

A lunchtime hangi being held at the art gallery tomorrow so lots of preparation is happening today, with individual food parcels being prepped, so as to help reduce the amount of work they have to do tomorrow. As a result, I sequestered myself away in the office to get some programming work done.

Minimap view of before and after code refactoring

Minimap view of before and after code refactoring

Refactoring nested levels

The issue that Im trying to unravel today is a deeply nested set of code, that searches through four nested levels of modules from a database and creates a report on the result. I’ve extracted some of the repeated behaviour out in to separate functions below the code, and am now getting down to trickier work of how to deal with lots of nested loops.

Can recursion be used instead to make things even smaller and more flexible? Hopefully with info about how to replace iteration with recursion, I’ll be able to make further progress on this tomorrow.

Board games night

It was off to Thomas and Letitia’s tonight for an evening of board games, which was somewhat at short notice due to there being nothing arranged until yesterday, but things still turned out fairly well with 5 of us there to share in the fun.

We kicked things off with Talisman, which has been doing the rounds for many years now. It can be tricky to play due to the board using lots of small text with half of it being upside down at the other end of the table, but such things can be forgiven since it was first released in 1983. 

Afterwards we brought out Munchkin, which gets the blood racing towards the end of the game, and is highly enjoyable all round, before moving on to the slower and more thoughtful Carcassonne, which is a tile-laying game set in a medieval Southern France province.

To finish the night we ended up with several rounds of Kakerlakenpoker which gets frantic at times, resulting in a lot of fun as we try to outwit each other.

Advertisements