BANGOR, Maine — On the nicest days of the year so far, 20 programmers in Bangor spent the weekend inside, donating time to hack projects for their local governments.

The projects in Bangor included a tool to track the location of city vehicles such as snow plows and street sweepers in real time, a map to track crashes at intersections in Bangor and identify problem junctions, and an interactive exhibit for the Maine Discovery Museum that can be controlled through the Internet.

The term “hack” often carries a negative connotation, but in the tech community the word means something that has been cobbled together quickly, often with limited resources.

The hackathon — an event where programmers work together to solve a problem — was part of the National Day of Civic Hacking. Hackathons were also held in Portland and Biddeford, and about 90 other cities across the country.

The hackers arrived early Saturday morning and worked until 3:30 p.m. Sunday, with little or no sleep. Most of those who did rest did so on the floor or a couch inside Eastern Maine Development Corp., one of the event’s sponsors. By the end of the weekend, the room was littered with pizza boxes, soda cans and electronics parts, but every team had a working prototype.

Officials with the city of Bangor and the Maine Discovery Museum — the benefactors of the hackathon who were on hand when the projects were presented — were surprised at how much work the group was able to accomplish in less than 36 hours and seemed optimistic the projects could help the community.

The project to track the city’s trucks, which this reporter participated in, can help ensure they’re using the most efficient routes and can save money on gas, for example. A better way to track accidents can help the city evaluate the effectiveness of its traffic patterns.

“I came in the beginning and elaborated on the problems that we wanted them to help solve. That was pretty much it — they ran with it,” said Sean Gambrel, a geographic information specialist for the city. “I was very impressed when we came back and they really had something functional up and running.”

“A lot of our programs, as with the state, as with the federal government, they were built in the 20th century for the conditions at that time, and they haven’t necessarily been modernized in a while,” said City Councilor Ben Sprague. “I think there’s a lot of potential to find some efficiencies in the way we do things.

“There’s budget problems everywhere, and the choices are always, ‘Can we cut expenses, are we going to raise taxes?’” Sprague said. “But the third solution is really finding less expensive ways to do things.”

And did the hackers regret missing the sun?

“It was tiring, but it was a lot nicer in here than it was outside, in my opinion,” said Justin Bond. “It’s too warm out there.”