A die will roll until the pattern 123456 has been rolled in that exact format
Henry Wong wrote:
Also, for a topic named "Why wont these nested loops run?", it must be pointed out that there isn't a nested loop in the code.
Henry
Daniel Hoang wrote:Well i got to it finally check for the entire pattern. But im having trouble getting the program to reset and try to roll for the first number whenever a number doesnt match. Right now, if i want to get 123456 and get a 1 on a roll, itll see if the next 5 numbers match 23456 before resetting. I want it to reset if i roll a 1 and dont get a 2 after.
Daniel Hoang wrote:Also i know its hard to read, im not allowed to use methods or arrays...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Daniel Hoang wrote:yes 0 means i havent got the number, 1 means i have. The condition i tried using for that loop is, keep rolling the die if none of the numbers in pattern have been matched.
look! it's a bird! it's a plane! It's .... a teeny tiny ad
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|