The scriptwriter for the Olympic opening ceremony is to jostle with David Walliams for a top children's comedy-writing prize.

Frank Cottrell Boyce, who collaborated with Danny Boyle on the spectacular celebration, is up for the Roald Dahl Funny Prize for his sequel to the classic book Chitty Chitty Bang Bang.

Walliams is also on the shortlist of six books in the seven to 14-year-old category with his comic novel Gangsta Granny. His tale of an OAP jewel thief has become his third book to make the shortlist since the awards were launched in 2008.

Cottrell Boyce - who has won acclaim for his children's books such as Carnegie Medal-winner Millions, a story which was filmed by Boyle - is also a previous nominee, making the shortlist in 2008 for Cosmic.

Pictured in London in 2011, Roald Dahl Funny Prize Judges. Credit: Lewis Whyld/PA Archive/Press Association Images

The shortlisted books also include Socks Are Not Enough by Mark Lowery, about a teenager who suffers the embarrassment of finding out his parents are secret nudists.

A further six books will compete for the six and under category, aiming to impress a judging panel which includes comic and broadcaster Mel Giedroyc.

She said: "It's a sheer privilege to tap into some great laughs from some fantastic books, and to hopefully put these books in the way of lots and lots of younger readers out there."

Chair of the judging panel Michael Rosen - who created the prize with reading charity Booktrust said:

Anyone who's interested in the idea of young people enjoying books will rush to get stuck in to this list of 12 great books - and indeed the previous years' shortlists - to find clever, odd, intriguing and above all funny stuff to read.

The category winners - who each stand to collect £2,500 - will be announced on November 6.

The shortlisted books are:

The funniest book for children aged six and under:

  • The Baby That Roared by Simon Puttock (illustrated by Nadia Shireen)

  • My Big Shouting Day by Rebecca Patterson

  • Oh No, George! by Chris Haughton

  • The Pirates Next Door by Jonny Duddle

  • Stuck by Oliver Jeffers

  • The Worst Princess by Anna Kemp (illustrated by Sara Ogilvie)

The funniest book for children aged seven to 14:

  • Chitty Chitty Bang Bang: Flies Again by Frank Cottrell Boyce (illustrated by Joe Berger)

  • Dark Lord: Teenage Years by Jamie Thomson (illustrated by Freya Hartas)

  • The Dragonsitter by Josh Lacey (illustrated by Garry Parsons)

  • Gangsta Granny by David Walliams (illustrated by Tony Ross)

  • Goblins by Philip Reeve (illustrated by Dave Semple)

  • Socks Are Not Enough by Mark Lowery