A new federally funded cellphone app allows people who may have had one too many to get an idea just how drunk they are – and hail a ride home.

Users enter their sex, height, weight, and number of drinks consumed to help figure out their blood-alcohol level. They also can play two interactive games to test reaction time and cognitive agility. And the app uses GPS technology to call cabs and pre-load phone numbers for potential designated drivers.

The app, called ENDUI – pronounced “End DUI” – was announced Thursday by government and police officials in Maryland. Funded by federal money reserved for drunken-driving education efforts, the app is among several in a handful of states to tackle drunken driving – though Maryland’s is one of the most elaborate.

“It’s unique,” said Kara Macek, a spokeswoman at the Governors Highway Safety Association, which funded the new app.

“I think states are starting to go that route because they’re trying to reach consumers where they are and where they spend time, and everyone spends time on their phone,” Macek said. “I think we’re going to see more of that as we go forward.”

States with similar apps include New York, New Mexico, Colorado, and California, which launched its version two weeks ago.

Like the other states, Maryland’s app is available for free on Android and iPhone.

One of the games on the app involves pressing a red “brake” button when an image of a pedestrian passes by or a car ahead stops. The app says just how fast – or slow – users react and how much time their car would have needed to avoid a collision.

The other game shows nine road signs that blink in different order; users try to recall the order, which gets increasingly challenging with each round – with or without drinks.

“The game is meant to be a hook and pull you in,” said Tom Gianni, chief of the Maryland Highway Safety Office. “Then it’s meant to give you a lesson of, ‘See what can happen. Imagine if you were behind the wheel.”‘