Created
February 9, 2019 12:50
-
-
Save sireliah/fe5fac19b508c14567bd8bae77e9dd90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let directions = &["down", "left", "up", "right"]; | |
| while !stop { | |
| for direction in directions { | |
| turn += 1; | |
| for _ in 0..times { | |
| if counter < numbers_len { | |
| stop = self.move_cursor(&mut x, &mut y, direction); | |
| if numbers[counter] == 1 { | |
| img.put_pixel(x, y, pixel) | |
| } | |
| counter += 1; | |
| } | |
| } | |
| if turn == 2 { | |
| times += 1; | |
| turn = 0; | |
| } | |
| } | |
| if (counter >= numbers_len) | (x <= 2) { | |
| stop = true; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment