Simple dice

Quite right. And if efficiency is a question, it is faster to perform direct port writes. But in my opinion this is overkill for a dice program, which needn't be at all high performing. Also, it wouldn't be appropriate to set all the pins to random values, because the goal is to have 2 seven-segment displays coherently displaying random digits. You must still encode the way each digit looks somewhere, and that usually means defining an array of bits or bytes.