Enter the maze

What card is that?

some doodles of the four card suit symbols

This card trick, with its completely impossible-looking effect, requires a friend with artistic or design flair. You will also need access to the web. In the performance you have your friend draw a picture of any freely chosen card. You tease them a bit about their less than perfect artistic ability, and decide the only way to really discover which card has been drawn is to ask a well-known search engine. You open up your web browser and to the audience watches as you type in the question on everyone’s lips, ‘what card is that?’ On pressing return the browser shows a list of websites that contain the actual name of the freely selected (and badly drawn) card in them. After all, the web is often a useful place to find answers…but how did it know what card was drawn? It’s a clever bit of web-based computer science of course.

First bookmark this special site, iPolygraph, in your browser. This is a spoof website specially created specially for this card trick using some cunning JavaScript programming. JavaScript is a computer language that is often used inside web browsers to allow them to manipulate and display information, and here the manipulation makes the magic happen. Take care; while most browsers will run this JavaScript correctly do check it works for yours before you perform the effect.

The Secret Code

Though it looks like a standard Google page (you can hide the website address bar if you really want to be safe), the computer program it contains allows you to secretly type in the name of the card, while the letters that come up on the screen read 'what'. For example: you know, thought you pretend to be unsure, that your friend drew a picture of the 7 of diamonds. In that case the secret code you type to enter this card name is /7d/. Did they draw the queen of hearts? You would type /qh/. Whatever you type on the screen it looks to observers like you have simply typed the letters w h a t. The rest of the words in the sentence don’t really matter, so you can play with that – 'what card did my friend Amy draw?', 'what is that awful picture of?' You get the idea. Be creative and come up with your own presentation.

Beware! Darker magic lurks

This magic trick was for fun, but all too often criminals create spoof websites to ensnare the unwary. If a criminal had to build a fake bank or shop, brick by brick, in the high street, people would notice and phew, it would be knackering. But often people don’t notice that in the looks-very-important-email-I-have- unexpectedly- received-that contains-a-handy-link-to-click-on, the website they are taken too, and that they think belongs to their trusted bank or shop is actually a ‘copy-and-paste’ fake. It looks like the original but sinister forces lurk behind ready to steal your information and the result won’t be fun for anyone but the criminals.

Believe me?

This magic effect is a good example of how the power of computer science can be used to have fun and to entertain, but one of the serious lessons to learn is to be careful what you believe online. Once it was smoke and mirrors that were used to innocently deceive, but now it’s copy-and-paste frauds, fake identities and pictures, spam emails and many other methods used to hide the truth, and sadly not everyone behind these are nice-to-know magicians.

Advanced

If you fancy getting deeper into the computer science why not click on 'view source' on that special webpage? That will show you the computer program that make the trick work. Can you do better?