4
I have a list with a property called tamanho
which may contain two values: "M" or "I".
I need this list to be random, but with a grouping condition.
"M" would be half page and "I" full. That is, I need to always have 1 whole and then 2 socks. Never 1 whole, 1 half and then 1 whole again.
I will use this to generate a PDF, as soon as I am sweeping the list it will insert 2 socks on the same page, or 1 whole, and never 1 half and more a whole then as the whole will not fit on the same page of the sock and will get a space.
My question is about the logic I need to apply to the list to get this result. I have no idea yet and need help.
The code is just a C list#.
List<Questao> questao = new List<Questao>();
// questao.Questao.TipoTamanhoQuestao acessa o valor "M" ou "I"
Could present the code implemented so far?
– João Alex
The code is just a C list. I saw no need to put.
– Joao Paulo
A small observation: the variable should be called
questoes
and notquestao
, since it’s a list.– dcastro