Help for this page

Select Code to Download


  1. or download this
    if (@movement == (0, 1)) {$from = "north"}
    
  2. or download this
    if (@movement == ($any_other_value, 1)) {$from = "north"}
    
  3. or download this
        my $from = "";
        if ($movement[0] == 0 && $movement[1] == 1) {$from = "north"}
        elsif ($movement[0] == 1 && $movement[1] == 0) {$from = "east"}
        elsif ($movement[0] == 0 && $movement[1] == -1) {$from = "south"}
        elsif ($movement[0] == -1 && $movement[1] == 0) {$from = "west"}