About 25 area kids were spending their Monday at the library, learning from college students.

Two of them — Nick Ruth and Nash Dickenson — were trying to decide what was more fun to do: spend a day at home playing video games or using their collective brainpower to create one.

“To me, both of them are equally fun,” Ruth said.

He and Dickenson were in a morning workshop using a computer software package called Scratch to write a game. Witches and cakes danced across the screen. Instructors had helped a group of 10 kids put together a basic game, then issued a challenge.

The challenge was to make the game harder — playable by the duo writing it, but difficult enough to trip up other players. Ideas that were floated about during a group discussion, and being implemented during a programming period, included time limits, making the game faster and putting it into a maze format.

“Once you are playing a game it can be a mystery,” Dickenson said. “When you are making it, you know what everything is. … This is fun.”

“I really like this kind of stuff and am into computer programming,” Ruth said.

Their instructors for the class were students from Stanford University in Stanford, California. As a group, the college students are bicycling across the country as part of a first-year SPOKES America project for Stanford.

As the college students pedal across the nation, they stop in towns along the way and put together “learning festivals.” The idea was started with Harvard and MIT students, who stopped at Newton Public Library for their version of the festival about two weeks ago.

Monday morning while youth were writing computer games in the library Bessemer room, another group was in the library board room in the basement. There, 15 students were learning about the human brain.

They learned about the different regions of the brain, and the functions of each. As they learned about each, they also learned what happens when different parts of the brain are damaged.

One asked about strokes, to learn that a stroke is a blood clot in the brain.

During an afternoon session, groups were performing creative writing exercises and playing math games.