Not really? It's illegal per Casinos rules, any Casinos. Using your mind shouldn't be illegal, but it is.
If it kinda sorta wasn't illegal to the Casino, why were you asked to leave?
Whatever the casinos say is illegal is just that, illegal. Inside their walls. If it's illegal to have two ashtrays at your machine, then it's illegal and you get bounced. If it's illegal to play two machines between 7 and 10 PM then it's illegal.
That's why there are multiple decks per shoe. To stop card counting before they have to kick you out.