Since you got rid of it you probly are not interested in this, but for anyone else, check your bulb connections. I had the same problem. Take care not to get any dirt or skin oil on the bulb, pull it out of the socket and push it back in.
I was think the same as you, bad switch, bad contact for batteries, something like that I was screwing around with the batteries with no succsess, except for as you mentioned an ocasional flicker as you tightened the tail cap. It was almost on its way back and I said to myself "self lets check the bulb". Low and behold that was it. It has worked fine every since.If it does still not work and you bought it at wally-world take it back for a new one. Wal-Mart is very good about things like this.