in reply to Re^4: How to get this not the usual round robin looping
in thread How to get this not the usual round robin looping

Ah, see that is the kind of crucial detail the homework would have specified .... my version came out like :)
{ H1 => [1, 8, 9], H2 => [2, 7, 10], H3 => [3, 6, 11], H4 => [4, 5, 12], H5 => [13, 20, 21], }