Basic Robot Movement Code [Javascript]