I basically need help on how I would be able to generate random unique pairs in C. To give specifics, its for a snakes and ladders game. I'm supposed to have 3 pairs for variables for the snakes and ladders, i.e SnakeTop1, SnakeBot1, SnakeTop2, SnakeBot2, SnakeTop3, SnakeBot3, LadderTop1, etc.
They must ALL be distinct unique pairs... To be more precise, we were given the conditions as follows: Ladder bottoms between 1-24, Ladder tops between LadderBot-25. Snake tops between 2-24, Snake bots between 1-Top.
I tried a while loop with a count, but that didn't quite work out for me... If you guys can help I'd greatly appreciate it!
Aucun commentaire:
Enregistrer un commentaire