It is better to download the code from the book's website rather than typing it in. Check your batteries have sufficient power. If you have motors connected to B and C your robot should start moving forwards when you run the program. Does it do this? If the NXT has shut down, pressing the orange (ENTER) button will start it up again. You can use this as a test of whether it has shut down. If you press the Orange and gray rectangle buttons together (ENTER + ESCAPE) and the NXT is still running you will see a line across the LCD display and the NXT will shut down. This shows that it was still running.