cube game formula