Making the Mancala Game App - Try Number Two

About a year ago, I started writing the promised Mancala Game app. I got about 50% to 60% done when I encountered a problem that I could't really fix: the computer language I was writing it in, Javascript, can't handle multitasking.

So, about 3 weeks ago, I started writing it again in Python, a language that should work fine. I'm also doing something unusual: I'm video-recording my development and adding commentary as I go along. I'm placing these videos up on YouTube. Think of it as the ultimate expression of transparency :).

Would you like to follow along? Here is a link to the playlist:

Mancala Game App Development

As of Feb 22, 2017, I have six videos posted. More coming soon.

A bit of warning though: you are literally watching a programmer write a program. It is a fair bit on the technical side.

For the Curious: Why was Javascript a problem?

I had written an AI to act as the opponent in the game. I got it to play a pretty decent game. And, on a full desktop Linux computer, it would make it's decision in less than 1/2 second at max level. Good.

But when I tried running it on a mobile devices, it would take 10 to 30 seconds (depending on the device.) And worse, while the CPU was locked up busily "thinking", the app would freeze up. No indicators that one should merely wait or anything: a solid freeze.

Modern phones have multiple multi-tasking CPU processors. But Javascript, it turns out, is not able to have the AI run on one processor and have the user interface run on another. Nor can it spawn a new process or task on the same processor. While perhaps not technically a bug, I don't think users would appreciate an app that freezes up for 30 seconds on every turn.



© 2017 John Dupuy dba Purple Squirrel Games. All Rights Reserved.