I have a problem as follows: One room can hold 13 people, one 9, and another 4. Rooms all start out empty 0 0 0 and can be filled to their capacity OR the contents of one room can be transferred into another. So, for a situation like 13 0 0, the 13 could fill the third room making it 9 0 4. And so on. I want to generate all different possibilities (follow each generation until I reach a END or a state I've already generated. I've already implemented this using LOTS of If Else statements... What is the most concise way I can generate this?
Aucun commentaire:
Enregistrer un commentaire