寻找洗牌四个变量(试图改变它们出现在多项选择列表中的顺序)。
我已经摸索了一段时间,但我无法完全理解逻辑,并且在过去的问题中查找随机洗牌给出了超出我的新手技能的超详细算法(以及我对这个程序的需求)我想写,我只想做一个多选图像选择器)。
理想情况下,我想要遵循这个伪代码的东西:
// int Answer1 = Random(min1 max4)
// int Answer2 = Random(min1 max4)
// int Answer3 = Random(min1 max4)
// int Answer4 = Random(min1 max4)
// If Answer 1 equals ANY of the other three, re-randomize Answer1 and loop.
// Loop through this cycle for all answers.
我会发布我当前的常规代码,但坦率地说,这是垃圾。:( 这似乎是一个足够简单的问题,但我就是做错了。
提前致谢!