Every Tihar, the festival of lights, courtyards across Kathmandu fill with the clatter of cowrie shells and spinning dice as families play kauda and langur burja. Most players assume it is just a festive tradition with a wink from the authorities. In fact, the five-day window for festival gambling is written into Nepali law — and it has been for more than 170 years.

The rules go back to the Mulukī Ain, the national legal code compiled under Jang Bahadur Rana in 1854. Its chapter on gambling runs to 16 sections, and the crucial one is remarkably specific: across the whole Gorkha realm, people could gamble legally for the five days of the Yamapañcaka (Tihar) festival and would not be held accountable — but nobody could play before or after. The window was opened publicly with sounding cymbals and closed the same way. The code also permitted gambling at a few other licensed moments: two days and nights at Pachali Ghat for Krishna Janmashtami, at Tundikhel for Chaite Dasain, and at Mrigasthali during the month of Kartik.

What is striking is how protective the old law was of gamblers. Stakes had to be coins — betting jewellery, clothes, weapons, livestock or people was expressly banned, a pointed rebuttal to colonial-era accounts like William Brook Northey's 1937 book The Land of the Gurkhas, which claimed Nepali men staked their wives and children on dice throws. Moneylending at gambling venues was prohibited, as was selling gold there, and anyone caught rigging dice or cowries had to return their winnings and pay an equal fine. Penalties for out-of-season gambling were harsh for adults — lose your property share or serve two and a half years — but children under 12 caught playing for money were simply told off and let go.

The history is longer and more contested than the Rana code alone. Prithvi Narayan Shah banned gambling outright after conquering the Kathmandu Valley, in line with Brahmanical texts that called it 'open theft'. King Rana Bahadur Shah flipped the policy in 1798, legalising it during Tij and then Tihar, and King Surendra's 1855 decree justified strict controls on the grounds that dice left ordinary people poor and indebted. Historian Simon Cubelic's research, drawing on archival documents from 1902, examines how these rules actually played out in practice.

For a traveller, this adds real texture to time spent in Nepal during Tihar, which usually falls in October or November. The dice games you see in family courtyards are not casual rule-breaking but the tail end of a formal, centuries-old legal exemption. Watching a game of langur burja — a card-based dice game — or the cowrie-shell kauda is one of the festival's most atmospheric sights, alongside oil lamps, marigold garlands and the worship of crows, dogs, cows and brothers over five consecutive days. You are unlikely to be invited to bet, and official tolerance does not make participation legal for anyone. But knowing that the state once opened the gambling season with a blast of cymbals makes the shells rattling across a courtyard board feel like living history rather than a folk curiosity.