Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn to_coordinate(cell: usize, size: usize) -> (usize, usize) {
- (cell / size, cell % size)
- }
- fn main () {
- let size = 3;
- for i in 0..size*size {
- println!("{} = {:?}", i, to_coordinate(i, size));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement