Can Someone tell me why this code doesn't work

What do you mean "doesn't work"? What does it do or not do?

On what Arduino is it running?