0
enums and protocol
can anyone explain how to use it!?
2 Respuestas
0
enum {
case North
case South
case East
case West
}
0
Here is a chunk of code That I created for you.
It moves a character back and forth 3 times printing when the edge of the screen is reached and switch the direction. After the third iteration it stops and tellls that the race is completed:
http://swiftlang.ng.bluemix.net/#/repl/57c64a92c62de72752d32274