Comma quibbling is a task originally set by Eric Lippert in his blog. The task is to write a function to generate a string output which is the conc
Continue ReadingC++: Dutch National Flag Problem
The Dutch national flag is composed of three coloured bands in the order red then white and lastly blue. The problem posed by Edsger Dijkstra is:
Continue ReadingC++: Guess the Number With Feedback
The task is to write a game that follows the following rules: The computer will choose a number between given set limits and asks the player for
Continue ReadingC++: Inverted Syntax
Inverted syntax with conditional expressions In traditional syntax conditional expressions are usually shown before the action within a statement o
Continue ReadingC++: Gray Code
Gray code is a form of binary encoding where transitions between consecutive numbers differ by only one bit. This is a useful encoding for reducing ha
Continue ReadingC++: 24 Game
The 24 Game tests one's mental arithmetic. Write a program that randomly chooses and displays four digits, each from one to nine, with repetitions
Continue ReadingC++: Bulls and Cows
This is an old game played with pencil and paper that was later implemented on computer. The task is for the program to create a four digit random
Continue ReadingC++: Josephus Problem
Josephus problem is a math puzzle with a grim description: n prisoners are standing on a circle, sequentially numbered from 0 to n − 1. An execut
Continue ReadingC++: 99 Bottles of Beer
The beersong In this puzzle, write code to print out the entire "99 bottles of beer on the wall" song. For those who do not know the song, the l
Continue ReadingC++: MD5
Encode a string using an MD5 algorithm. The algorithm can be found on wikipedia. Optionally, validate your implementation by running all of the tes
Continue Reading