How to get in the zone

Be very careful with this knowledge. Use it sparingly.

Yesterday I had a mountain of work in front of me. It was 3 pm and I knew I would be working until at least 7 pm.

I took a deep breath and reached for a Spotify playlist called 'Deep Focus'.

I took one large slug from my coffee cup, pressed play on Spotify, and turned toward my work.

It was as if someone had pressed the turbo button on my mind.


Within moments the hyperdrive was fully engaged.


I sped through the galaxy at beyond light speed.

2001 odyssey zing

All knowledge and facts and wisdom of the ages were immediately available for use by my expanded neural membranes.

leon thinking

A bubbling fractal panorama of tasks roiled up in front of me and was completed and delivered as quickly as it emerged.

trippy landscape

I was a digital demigod surveying the writhing landscape of technical problems, assisting the lightning arcs of insight to cut down from the bubbling clouds of possibility and materialize into the dazzling particles of fully realized innovation.

There was no yak whose hirsuit locks could challenge the sharpened razor of my wizened scalpel.

Less than an hour later I pressed commit on the last of these tasks.

I looked down to find my coffee was cold, completely untouched.

There was no more work to be done. I basked for a moment in the featureless landscape of a world with no remaining tasks. It was warm and dark and devoid of form. I felt at peace and at one with the flowing energy of the universe.

What I'm saying is that the Spotify 'Deep Focus' playlist is OK.

This morning I listened to the playlist once more. It sounded trite and useless. The magic was gone. I'd become immune to the effects, I'd grown tolerant to the active ingredient. I'd need to up the dose if I wanted the same high.

Now I'm on the prowl for playlists that bring a deeper and deeper sense of focus. Will I ever get back into that zone? Send playlists.


Publishing on Amazon: Lakes Creek Adventures

I turned my Dad's handwritten memoirs into an actual paperback book, available from Amazon (and on Kindle) under the title "Lakes Creek Adventures".

Cover of Lakes Creek Adventures

See 'Lakes Creek Adventures' (at Amazon)

And you can do the same. Need advice or assistance? Ask me anything in the comments or by email to leonbambrick at gmail. (Seriously, you're welcome.)

The book covers just the years of World War II wherein my Dad, a sandy-haired kid aged 6-12, was raised in a pub (a hotel, a drinking establishment) in Rockhampton (Queensland, Australia) in a large family. During the last half of the war, Rockhampton expected to be attacked by Japanese bombs at any moment. The population of Rockhampton was doubled with an influx of 42,000 American soldiers. It was a surreal time to grow up, and full of adventures.

corrugated iron canoe sm

Making the book 'print ready' was an educational exercise. After a bit of research, I decided to use CreateSpace (an Amazon company) and mostly followed this guide: A Step-by-Step Guide to Book Publishing with Createspace. I've had published authors look at the product and be surprised at the level of professionalism. It could be better, but it's far from terrible and my dad was very happy with the result.

If you get the chance to do the same, I heartily recommend it.


Using Computers to Invent New and *Fun* European Style Board Games

I've been playing board games with some of my nerd buddies lately, and, as always happens when I partake of cultural activities, the creative impulse is fired up and I start thinking (mono-maniacally) about how to make my own.

As I see it, there are 3 major design aspects for these games:

  1. Theme
  2. Mechanics and
  3. Art work.

Theme and art work can be evaluated using your own sense of taste.

But mechanics can only be evaluated by "play testing". And this is the major limiting factor for a solo designer; even for a team of people this a very resource intensive problem.

So my mind then turns to genetic algorithms (GA)... how can I build a system that represents the rules of a game in such a way that they can be evolved? And in particular: how can the effectiveness of a set of rules be evaluated?

There's two tricky aspects here:

First you'd need to build a general game playing engine that can play the game against itself.

Second, you'd need it to provide information about how "fun" a given rule-set is to play. This sense of "fun" is the crucial thing that needs to be defined.

But on that first problem for a moment: a general game playing engine. My research led me to find that there are "general game playing" engines out there. And the academic term for them is (drum roll) "general game playing engines". One example is Zillions of Games("ZOG") which encodes rules as S-expressions. (Old timers: yes lisp of course; newbs: like JSON.) ZOG includes a 'self-play' mode in which it plays the games against itself. I don't know how good it is at the games.

However ZOG is not capable of representing the kind of games I want to evolve.

Background reading:

I read this short paper: Automatic Design of Balanced Board Games (pdf)

This was an interesting and very straight forward read.

They used ZOG and a GA to explore rule variations in 2 player board games (such as checkers, reversi, connect 4) to evolve rule systems.

They had a very limited sense of "fun" Comprised of just two things:

  1. Don't confer an advantage or disadvantage to the first player (they call this "balance" -- though game designers use the word balance for a lot of other concepts too)
  2. Avoid games ending in a draw.

Representing any type of game.

In my theoretical system you'd need to be able to represent all sorts of games that combine cards, boards, pieces, trading, information hiding, and so forth.

It might be worth describing first a single "über" game that demonstrates all possible elements.

Here's a partial example.

(Numbers like X6 are numeric variables which would be set in the rules. Most such variables would be equal to zero.)

Start of game

  • Each player is given X1 "Action" cards and X2 "currency1" cards and X3 currency2 cards and x4 "currency3" cards (and so on for N1 types of currency).
  • They are also given X5 Power cards, and X6 cards from a shuffled deck of all card types. They hold these cards where other players can't see them.
  • They are also given X7 cards, face down which they cannot see.
  • And X8 cards which are placed facing out in front of each player, such that they cannot see them but every other player can. They also have X9 cards face up in front of them.

The layout and setup of the board(s) would need to be described in a similarly generic way.

A turn might be described something like this:

  • Player may roll a dice, result d1.
  • Player may roll a dice, result d2.
  • Player may flip a coin: c1.
  • Player discards n2 cards from their hand, turns over n3 cards, picks up n4 cards and discards d1 cards from their hand and picks up d2 cards.
  • Player may choose to play A1 action cards. Or they may allowed to buy the right to play up to A2 action cards. They may...


A possible "building" phase and a "trading" phase would be included as well, including moving pieces on a board, and trying to guess some series of facts.

Game ends when any player fully understands the rules. Ha ha.

Let's say we succeeded at building out a complete über game in that manner. It would be trivial to represent in a GA and easy to combine/mutate. The challenge would then be how to evaluate the "fun" that each player has.

My idea of fun

It's generally fair to say that the first player shouldn't be more or less likely to win than any other player. And games resulting in a draw are not satisfying. So we'd need to inherit those two rules.

But there's a lot more to it as well.

The sense of fun that you're targeting will be different at different times. You might want a game that is quick to play or long to play. You might enjoy learning a few complex rules, or a lot of complex rules. You might like games where the optimal strategy to employ changes throughout the game. You might like it if there is a constant change of who is in front (unlike, say, monopoly, where one person gets in front and then slowly destroys their competitors over a long period of time). You might be able to evolve games where being in front is a disadvantage until the end: or you might hate that.

It's crucial that every part of the mechanics has an influence on winning/losing. You shouldn't need to hold more than a few things in your short term memory. Card counting probably shouldn't be rewarded.

You might like games that involve double-crossing. You might hate such games. You might like games that reward skill, or that have a certain mix of skill and luck.

You may need to try encoding other succesful games and see if you can find a way to measure the types of fun that they involve.

Anyway -- it sounds like a big task. I wish you luck. I think I'll get on with doing other things.

Something easier

Anyway, while researching this I was at Board Game Geek, and under the "Board Game Design" part of their forums I noticed a Seeking Play Testers forum.

This gave me an idea for a film or series of films, or a sitcom:

A frustrated boardgame designer abducts a group of nerds, and keeps them in an underground lair, where he forces them to playtest his hundreds of wacky game ideas.

It would be a comedy but would also be spooky creepy scary fun and drama too. I picture the nerds as being a kind of Buffy Gang, though maybe with a bit of an IT Crowd tilt.

I think this could be an awesome sitcom. I'd definitely watch it. So instead of making that complex game evaluation engine, why don't you bash out a few episodes for "Games Underground."

Email me the royalty checks when you're done. Cheers.

External Links


Dadding 101: Give Your Kids A Trail of Codes To Break

This is one of those classic parental games that's fun and educational.

My youngest kidlet was home sick last week, and she happened to find a strange note that was composed of just numbers.

Where did this note come from? What did it mean? It was most puzzling.

She's only just learning to read, and getting her to do her reading writing tasks is pretty challenging. But she's read enough Billie B Brown Secret Mystery Club books to know that a note composed of just numbers is always the start of an exciting adventure.

She went with the assumption that "A=1", drew up a translation chart, and she was away!

IMG 2489 th.jpg

IMG 2490 th.jpg

When decoded the message told her to look on the printer. When she went to the printer there was a fresh note that required decoding. That one led her to under the stairs.

And so on, all day long, she chased a linked-list of notes, and practiced de-referencing a pointer, like a good little program.

The final clue told her to ask her mother for the next clue. Mum produced a clue, which when decoded, said "It's ice-cream time!" and everyone was happy with that. I was particularly pleased because I had no idea of how it should end, and sent it to mum as an easy exit.

All up, I strongly recommend trying this kind of puzzle on your own kids, or any kids you find in the neighborhood.

The simple "A=1" puzzle was good for a 6 year old, but you can progress to harder encryption techniques for older and more wizened children, or have the puzzles increase in difficulty as they go. My eldest would've lost interest if she'd been given the same material.

A good "next step" would be a Caesar Cipher, where the "shift" amount is provided. A good step up from that is a Caesar Cipher where the shift amount is not given. That leads into the topic of frequency analysis (though other approaches will work fine too). A nice code to demonstrate is the 'pigpen cipher' (also known as the Freemason cipher), particularly because of it's cool alien-looking characters.

My good buddy and aussie-bush-walker Dr Richard Mason says the EJ12 series of books have some great codes and puzzles aimed at kids (girls in particular). The "39 Clues" is another series I've heard of but haven't seen.

Have you ever tried getting kids into code-making or code-breaking? What happened?


The Ultimate Star Wars t-shirt

After toiling for eons in the my idea-factory, I finally present to you the Ultimate Stars War's t-shirt:

star wars t shirt ultimate

You will turn heads as you move through the crowd wearing this instant classic.

Whether it is the thrill of seeing their favorite character, the delight of the perfectly on-brand typography, or the joy of such precision alignment, any TRUE FAN will immediately grab you by the shoulders and demand "WHERE CAN I GET ONE!?"

The answer is: right here my friend:

Ultimate Starwar's t-shirt

Nerdy discussion that ruins the fun...

Now that you've finished ironically buying one, I want to talk about product ideas for a moment.

I tweeted about that shirt last week, and my mentions immediately filled up. It was an obvious hit within minutes.

This doesn't happen to me very often, so I like to take notes when it does. And this blog is where I put the first draft of those notes.

Fortune of course favors the prepared Boyscout or something like that. It only took a few minutes from having the idea to unleashing the product; it was ridiculously quick. But there were hours of behind the scenes preparation that put me in this position: last year I hosted the inaugural Stupid Ideas Powershell Slackathon, during which I created a command-line tool that let's you turn error logs into t-shirts: Out-TShirt. Developing that also meant I was already signed up and approved to sell at teemill. And it meant that once I'd completed my work in MSPaint, I could turn it into an online shirt (and put the resulting url in my clipboard) with a single command:

dir "bad_shirt_idea.png" | out-tshirt | clip

When you're trying out product ideas you're looking for a demand signal. If you don't get a demand signal, then you ditch the idea or make a big change. Once you get the demand signal you only make small changes. You don't keep trying to sell a product that won't sell, you propose little ideas, continually, and see what the market tells you. If you've done well, you'll hear about it. If you've done badly, you'll hear nothing.

In the long periods between seeing 'demand signals' it's easy to forget that these signals exist. So, as a nerd and an archivist, I want to record some of the forms that the demand signals took in this instance. This is the kind of detail I gather up and try to understand, as research for my forthcoming book on making products.

Some of the things I saw happening in my twitter mentions were:

The signs may be more subtle than they were in this case. But the only point I'm making is: look for the signs. If you see the signs, then take advantage of them. If you don't see the signs, move on.

Now go sign up to be notified in case I ever finish the god damn book. (p.s. I *will* finish it.)

p.s. the shirt is available in black and yellow now too:

black and yellow 50


pushpop, a mental stack manager

You're working on one problem, when another problem arises... or perhaps an interruption occurs... now you need to push the new problem on top of your mental stack, and the old problem moves down deeper into your soul. You start to solve the new problem, but remain ready to come back and solve the previous problem.

What do you do?

everyday problems

Turn to pushpop.

pushpop is a mental stack manager.

It lets you see the top of your mental stack.

push pop


When you've completed a task, click pop. (it makes a nice popping sound) and that task is gone.

The next item rises back to the top of the stack.


But wait... you are interrupted in your quest to complete the item on top of the stack.

What do you do? You enter the new item into the textbox, and push it. Now that item is on top.

push pop pushed


There's one more feature... peek...

push pop

Peek lets you inspect the entire mental stack. You can drag items around to reorder them. You can search for items (and can move the item you find to the top of the stack).

Finished peeking? Click peeking... to hide the stack away.

OK, OK, nerdy note... in proper 'stack' parlance, 'peek' is the operation that lets you see the item on top of the stack without popping it. Looking at the entire stack is called 'snooping' (well that's the slang term we used at university when i was kid...) But I'm using Peek here because I like the aliteration. The CLI would call it 'snoop' however.


While peeking, you can also view previously completed items, if you click history....

Current status

As you can see from the balsamiq mockups above, this is just in the idea phase. It's based on Next Action


There could be a command-line interface.

pushpop --peek                 # shows you what's on top
pushpop --push "debug the sql" # puts a new item on top of your mental stack
pushpop --pop                  # returns the top most item, but also removes it from the stack (and archives it?)
pushpop --snoop                # shows all items currently in the stack, from top to bottom.
pushpop --history              # shows all completed (i.e. previously popped items) including datetime of completion.
pushpop --help                 # provides help with pushpop and life in general


I've created a repo for the project, but written no actual code as yet.

pushpop on github

Implementation is left as exercise for the reader. I suggest electron. Send me a pull request when you're done.

If the stack was stored in the cloud then you could also have iOS/android version for managing your mental stack while on the move.

Last thing

I didn't mention Yak Shaving. Why didn't I mention yak shaving? Here's a yak in need of a shave:

Yak needing a shave

Yak image from wikimedia commons


Productivity Flowchart: 13 years in the making

TL/DR: Go here:


The very very first article I tried to write for this blog (before it was even a blog) was called 'GeekBlock' waaay back in September 2003. The article was about a process for getting un-stuck. It has always amused & annoyed me that the article sits there unfinished.

Eventually I rewrote it as an article at with the humble title: 'A 3 Minute Guide to Fixing All Your Productivity Problems Forever.' But its non-linear structure was simply too tricky to follow. People who read it said they got lost about half way through.

Finally, I rewrote it as a tiny application; an interactive flowchart, a choose your own adventure, a tiny state machine. Now I'm happy with it. You can play with it here:

Productivity Flowchart

Some people have suggested I re-write it as an infographic (What is this, 2015?) but I like it as it is. It'll be due for a rewrite in another 13 years, around 2030, I guess.



Last year I spent a few weeks completely away from all computers. In this primitive state of savagery (that some refer to as a 'holiday') I took to playing a little Sudoku each day, using old-fashioned materials known as pen and paper. Let me tell you, pen and paper are severely over-rated. Devoid of any computing facilities, I found that — much like Porky Pig whom, whenever he's forced to diet, begins to fantasize about food — I began to fantasize about programming. And Sudoku in particular got me really excited.


I decided there were three interesting challenges here:

  1. How to start with nothing and create a fully solved board.
  2. How to remove numbers from a fully solved board until an interesting game is created.
  3. How to solve a partially completed board: i.e. how to play sudoku.

Start with nothing and create a fully solved board.

In my techno-isolation I came up with an algorithm that I thought would have no trouble generating solved boards.

Here it is in pseudo code.

Do this for each number from 1 to 9, using variable "i".
    For each row:
      Keep doing this until you've placed the number i somewhere on that row:
          Pick a random cell.
          Check that the cell is empty.
            And that "i" does not appear in the current column.
            And that "i" does not appear in the current 3*3 subgrid.
          if all three criteria are met, then place "i" in the current cell.          

I thought to myself... will this process get stuck? Of course it won't, I thought. How could it!

This is because, as it turns out, when I am away from a computer, my brain turns into useless jelly.

When I was finally sat in front of a computer and wrote a version of the code (using LinqPad) I found that very often it did break down.

Here's an example:

_   4   _   |  _   _   3   |  2   1   _  
_   3   _   |  2   _   1   |  4   _   _  
1   _   2   |  _   4   _   |  _   _   3  
_   2   _   |  4   _   _   |  1   3   _  
3   _   1   |  _   2   _   |  _   4   _  
4   _   _   |  1   3   _   |  _   _   2  
_   _   _   |  _   1   4   |  3   2   _  
2   1   4   |  3   _   _   |  _   _   _  
_   _   3   |  _   _   2   |  _   _   1   ← Try and place a "4" on this row!

Sometimes, the numbers that have already been placed will put so many constraints on the next number, that there is no solution.

I ran the program a few times and found that sometimes it stopped at 3 numbers, sometimes it made it as far as 6 numbers.

I thought I would need to write some clever algorithm that tries to shuffle the problem numbers around, to break the deadlock.

In the example above, we could shuffle some other '4's around, to come up with a workable solution... for example....

_   4   _   |  _   _   3   |  2   1   _  
_   3   _   |  2   _   1   |  _   _   4 → move this 4 from first to third position
1   _   2   |  _   4   _   |  _   _   3  
_   2   _   |  4   _   _   |  1   3   _  
3   _   1   |  _   2   _   |  _   4   _  
4   _   _   |  1   3   _   |  _   _   2  
_   _   _   |  _   1   4   |  3   2   _  
2   1   4   |  3   _   _   |  _   _   _  
_   _   3   |  _   _   2   |  4   _   1  ← Can now place this 4.

And if shuffling 4's above isn't enough, we could expand the range of our shuffling.

But then I had one of those Engineering Breakthroughs you read about in clever articles on Hacker News. (Mathematicians are never as clever as this.) "Sometimes it hits a deadlock by the number '3'... sometimes it gets as far as '6'... what if I just re-run it a bunch of times, and see if it ever completes?" aka, The Retry Pattern.

So I put a loop around it and said, "keep going until you're stuck, then restart from scratch, over and over."

And thus, within a second, it would always succeed at creating a sudoku board. Sometimes it would have to start over only 3 times, sometimes it would be over a thousand times. But I always had a complete new sudoku board in much less than a second.

That was good enough, and no need to perform any tricksy mathematics to "satisfice" the problem.

I came up with similarly simple approaches for the other two problems. I've put some c# sudoku code online.

I can now type "linq sudoku" (from powershell) and see a fresh sudoku to solve, any time I feel like it. Which it turns out is not very often.


2016 by the numbers:

After reading patio11's voluminous rundown of 2016, I decided to run some numbers of my own. Here's what I came up with as far as creative output outside of work and family time:

No wonder I feel soooooo tired.


Television Bankruptcy

I am declaring myself bankrupt on consumption of new media.

In particular I've declared television bankruptcy. Heard of some amazing new show? I don't care anymore. My ears are shut.

It also means that I can't ask anyone else to avoid "spoilers" on anything. I just assume up front that if I haven't watched it yet I may never watch it: even if it's a new seasion of show I love. Spoil away. I'm a TV bankrupt, I can't take any new loans against future viewings.

On the plus side, this frees me up to read about stuff on wikipedia in advance of seeing it though... some things I think I enjoy reading about more than actually watching, for example, critically acclaimed films from before the 1980s... often boring to watch, but interesting to learn about. (Putney Swope in particular springs to mind)

Same for books. I have a short amount of time each night (Min: 0, Max: 20, Mean: 3, Unit: minutes) to do any reading. I need to find really choice material that will hold my attention for possibly months on end. I'm still working on deciding what to put into this gap.

Mostly for the last year or two I've been reading a steady diet of Sci-Fi. But it's hard to find anything good enough when the diet is so limited. I'm now in the category of "If you only read 1 book this year... make sure it's...${this_book}"

Book suggestions welcome. (Spoilers about television shows are also permitted.)