Mickey Rose was a childhood friend of Woody Allen’s, sharing his pal’s fervent enthusiasms for baseball, jazz and movies and later becoming the young filmmaker’s writing partner for his early, madcap comedies “Bananas” and “Take the Money and Run.”

Mr. Rose, who went on to become a television comedy writer, penning jokes and sketches for Johnny Carson, Sid Caesar and other top comedians and shows of his era, died April 7 at his home in Beverly Hills, Calif. He was 77.

The cause was cancer, his daughter, Jennifer, said.

Born in Brooklyn on May 20, 1935, Michael Rose, known as Mickey, was the son of a single mother, Sylvia Subin. His father left the family before Mickey was born.

Mr. Rose and Allen, who was then known as Allan Konigsberg, grew up in different sections of Brooklyn but met in a high school art class. They immediately hit it off, according to Allen’s biographer Eric Lax, and became frequent hooky partners, skipping school to watch the Brooklyn Dodgers at Ebbets Field or trek into Manhattan for a movie.

The friendship endured. Mr. Rose and Allen played baseball and were in a jazz band together — Mr. Rose played drums — and both enrolled at New York University, from which Allen eventually dropped out. Mr. Rose continued, studying film and earning a bachelor’s degree.

Mr. Rose was among several writers for Allen’s first film, “What’s Up, Tiger Lily?” in 1966, originally a Japanese spy film that was overdubbed with zany new dialogue. He and Allen then collaborated on the screenplays for 1969’s “Take the Money and Run,” with Allen starring as an inept bank robber, and “Bananas” in 1971, with Allen as a New Yorker who stumbles into an unlikely role in a Latin American revolution.

They wrote their material together, furiously tossing jokes back and forth and finishing the script for “Take the Money and Run” in a room at the Plaza Hotel in just three weeks.

Allen also arranged a blind date for Mr. Rose with a friend, Judy Wolf, who would become his wife. She died in 2003 after 40 years of marriage. In addition to his daughter Jennifer, a stand-up comedian, Mr. Rose’s survivors include his son, Quincy Rose, a filmmaker; and two grandchildren.

In 1970, Mr. Rose and his family moved west, settling in Beverly Hills. He wrote for many TV comedy shows and series, among them “The Smothers Brothers,” “All in the Family,” “The Odd Couple” and “The Tonight Show.”

But by the mid-1980s, his son said, Mr. Rose’s opportunities had become fewer and he largely stepped back from comedy writing. His family said Mr. Rose and Allen had remained in touch through the years.

“Mickey was one of the funniest humans I know, a true original and a total eccentric and a wonderful first baseman,” Allen said in a statement his biographer released this week. “We played a lot of baseball together. Once, when I asked him what death meant to him he said, ‘No more malteds.’ ”

— Los Angeles Times