Barcelona isn't Las Vegas or Monte Carlo which doesn't mean you can't test you luck and play games that might not make you rich, but could pay for a couple of drinks. Many bars and restaurants have slot machines, and in addition to that there is the famous Barcelona Casino near Port Olimpic. Unlike it's counter parts on the Vegas strip, there is no internet casino, which is probably for the best as the location offers visitors sea views, a discotheque, and a choice of restaurants: either a traditional casino buffet or Mediterranean cuisine.
But of course, you don't go to a casino for the nightlife and unlike the slots you'll find in the restaurants throughout Barcelona, the casino offers games such as black jack, roulette (French & American style), plus poker to test your luck and win some serious cash. To play any of these games, you'll need an ID (preferably a passport) and to dress appropriately (no bathing suits, flip-flops etc).