Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug, Clone, Copy)]
- enum MapTile {
- Dirt,
- Grass,
- Water,
- }
- #[derive(Debug)]
- enum MapTile2 {
- Dirt,
- Grass,
- Water,
- }
- fn main() {
- let map = [[MapTile::Dirt; 8]; 8];
- let map2: Vec<Vec<MapTile2>> = (0..8)
- .map(|_| (0..8).map(|_| MapTile2::Dirt).collect())
- .collect();
- println!("{:?}", map);
- println!("{:?}", map2);
- }
Add Comment
Please, Sign In to add comment