Partway through “Queen of Katwe,” Ugandan chess teacher Robert Katende sits at a homemade board across from a promising student, Phiona Mutesi. She isn’t yet in her teens, but she has soundly beaten him. He asks, “You can think eight moves ahead?”

Many viewers will find themselves easily outthinking “Queen of Katwe,” a predictable biopic directed by Mira Nair. It’s a familiar kind of movie (think “Cool Runnings,” “McFarland, U.S.A.” and “Eddie the Eagle”) but with a few important differences. This is the rare movie about competition and personal ambition with a girl as its central figure, and its entire cast — aside from the tiniest roles — is black. That, along with several solid performances and the vibrant backdrop of Uganda, makes this upbeat Disney movie worth recommending.

Katwe is a Ugandan slum, a place of hardship and danger but also joy and warmth as seen through the eyes of young Phiona (Madina Nalwanga, a charming newcomer). Her single mother, Nakku Harriet (Lupita Nyong’o), is raising three children; they sell maize in the market and sleep in a shack. This is a family so poor that even the latchkey kids at the local rec center look down on them.

That local center is run by Katende (a down-to-earth David Oyelowo), who beckons Phiona inside and teaches her chess using homespun metaphors. The pawn is “the little man,” while other pieces become robbers or “angry property owners.” Phiona takes to the game instantly, and soon — much sooner than she expected — is traveling to championship games as far as Russia.

Based on an ESPN Magazine article and book by Tim Crothers, “Queen of Katwe” may not have the clearest narrative arc, but it takes pains to show the obstacles Phiona faced: dire poverty, a lack of education and the fear that, for all her talent and hard work, she may never improve her lot. In a nice touch, the film ends with the actors posing next to their real-life counterparts, a respectful reminder that we’ve just seen the glossy Disney version of a very real story.