dominos.cpp fully commented