I'm creating a simple top-scrolling racing game. The concept is quite simple - the player controls the car, which goes on a dynamically generated field with square blocks. Once the car hits a car, the game ends.
My first implementation was simply to put a few random blocks in each row being generated on the top of the screen, but this does lead to maps where going through is impossible.
What is the best algorithm for generating such type maps? My platform of choice is XNA and C#, if that's important.
EDIT: Here's an illustration: (pic)
In this case, there's no possible way for the player to pass.
