Ruby, (削除) 66 64 (削除ここまで) 61 bytes
->w,h{[*1..w].product([*1..h]).sort_by{|a|[q=a.sum,a[~q%2]]}}
How it works:
First, create the set of coordinates from the cartesian product of X and Y, then sort by sum and then by ascending or descending X alternatively.
Ruby, (削除) 66 64 (削除ここまで) 61 bytes
->w,h{[*1..w].product([*1..h]).sort_by{|a|[q=a.sum,a[~q%2]]}}
Ruby, (削除) 66 64 (削除ここまで) 61 bytes
->w,h{[*1..w].product([*1..h]).sort_by{|a|[q=a.sum,a[~q%2]]}}
How it works:
First, create the set of coordinates from the cartesian product of X and Y, then sort by sum and then by ascending or descending X alternatively.