Guest User

Untitled

a guest
Sep 21st, 2019
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.30 KB | None | 0 0
  1. class GameMap {
  2.   has Int $.x_dim;
  3.   has Int $.y_dim;
  4.   has Array[Array[Int]] @.map;
  5.  
  6.  
  7.   method generate_new_empty_map() {
  8.     my Array[Array[Int]] @t_map = [[]];
  9.     for 0..$.x_dim -> $x_i {
  10.       for 0..$.y_dim -> $y_i {
  11.         @t_map[$x_i][$y_i] = 0;
  12.       }
  13.     }
  14.     @!map = @t_map;
  15.   }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment