The Little Book of Algorithms 2.0
The excellent William Lau has made his useful book freely available to download or available to buy a physical copy online.
This has a huge range of fun programming tasks for all levels. Python based but easily adapts to other languages. A great resources to use if you are looking for ideas for programming challenges. You could assign as homeworks or for pupils to complete in a swam based style task.