arduino uno and L293D IC help....noob here

There's nothing wrong with your code. I tested it with my hardware.
Your problem is 100% hardware or operator error (miswire). You said your motor was a 12V battery but your not running it on 12V.