Arduino Wifi Shield problems

Hello,
On my Laptop I have Setup an Ad-Hoc Network using WPA2 Encryption Using the SSID test and password 12345.
Then i copy+pasted this code and uploaded it into my Arduino UNO (which as a wifi shield on top of it):

I changed the line

char ssid[] = "networkName";

to:

char ssid[] = "test";

and the line

char pass[] = "yourPassword";

to char pass[] = "12345";

After uploading, it always tells me it "couldn't get a wifi connection"...
How can i fix this?

Thanks!

As far as I know the WiFi library doesn't support ad-hoc networks yet. You either have to setup an infrastructure type network (access point/router) or wait for an update of the library and the WiFi shield firmware.

but on the arduino wifi shield page (http://arduino.cc/en/Main/ArduinoWiFiShield) it says that the shield supports ad-hoc...

i just want to connect my laptop to the arduino to control a robot...

In my version of that page it doesn't say so. Can you quote the sentence where you found the word "ad-hoc" on that page?

There is more than one way to connect a laptop to a WiFi shield.
If Ad-hoc doe not woirk, perhaps the Arduion WiFi shield can work as an Access Point (AP) and you can then connect your Laptop to the Arduino (rather than the Arduino th the Laptop).
If that does not work, then you can buy a little pocket router for ~$30 that you run in AP mode and then connect your laptop and the Arduino to.