While about 20 first-graders sat on the floor in a classroom at Plymouth River Elementary School in Hingham, teacher Sue McHugh drew on the white board and stepped away.

“What’s the name of this shape, everybody?” McHugh asked.

Next, McHugh drew a rectangle.

“Put your thumb at your heart if you notice a difference in those two shapes,” McHugh said. Most of the kids did.

So far, this method probably doesn’t sound too different from how you learned about shapes. But then, another teacher stepped in and asked the kids to make space on the floor. Squares and rectangles were outlined in masking tape on the carpet.

Computer science teacher Tina Wehner held a yellow-and-black plastic bumble bee with buttons on the sides. It wasn't a child's toy, though. It's a robot, called a Bee-Bot.

“We’re going to program this Bee-Bot to go around the square, but let’s break it down a little bit,” Wehner said.

This is a math lesson about shapes and perimeter, but the kids are also getting their first lesson in computational thinking, how to break down problems into small, manageable pieces. Research shows kids as young as four can understand these concepts. Hingham school officials are banking on the notion that if all kids learn the basics at an early age, they’ll have no problem building apps or programming computers to analyze DNA when they get to high school.

“We know we have to push the forward button two times to get it down the side of the square," Wehner told the class. "What’s the next part of the problem?”

The kids' eyes were locked on the Bee-Bot as they told Wehner how to move it around the square.

“I noticed you were repeating what you were saying, ‘Press the Go Forward button two times. And then turn. And then press the Go Forward button two times. And then turn,'" Wehner prompted the kids. "That sounds kind of to me kind of like..."

“A pattern!” a little girl wearing a headband said, springing onto her knees.

“Yes! A pattern. Very good!” Wehner said. “So we did recognize there’s a pattern going on here, right?”

Hingham school officials plan to immerse kids in these concepts by integrating them into math and other subjects.

“Rather than trying to shoehorn a new initiative into an already packed schedule, we’re taking the purposeful approach of trying to integrate,” said Katie Roberts, who heads science education for the district. “So in lieu of a traditional math lesson on geometric shapes in first grade, today you saw a different approach to teaching those same concepts.”

Hingham Public Schools received a grant from the town’s education foundation to buy the Bee-Bots, and other technology, and train teachers. The foundation also played offense with parents who may have questioned the new computer science training.

“This is not about having students parked in front of a screen, passively working on a computer,” Roberts said. “I think that would have potentially been a misconception. So we did an enormous amount of outreach. Once they see it in action, they’re 100 percent supportive.”

This year, regular classroom teachers from kindergarten through fifth grade will use Bee-Bots and other programmable technology in their classrooms to help teach math and other subjects.