Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

larswik

macrumors 68000
Original poster
Sep 8, 2006
1,552
11
I am finalizing my dice program and I have a NSTextField that show the value of the most rolled dice number. I use a for loop to iterate from 0 to 99 and if the number rolled is 28 I do basically 'array++;' which increments index 28 to a value of 1 and so on. There is something in the code that is wrong and no matter what the next number will be 29, 30 and so on.

I turned on the break points but I need to go through many rolls of the dice to see what is happening. 1 pass is not enough.

Can I set up the debugger to loop?

-Lars
 
Never mind, lars = stupid. I just had to hit the dice roll button again. I was pressing the continue and never even thought of pressing the roll button again.

Sorry.

-Lars
 
Never mind, lars = stupid. I just had to hit the dice roll button again. I was pressing the continue and never even thought of pressing the roll button again.

Sorry.

-Lars

In this kind of situation, setting up a condition on the break point can useful. You can have the break point only trigger under certain conditions, such as a variable have a particular value.
 
I did set up break points to stop at certain conditions. I also found out with the debugger that I can insert numbers into the int values so I don;t have to keep hitting the roll button. I could change the value of die number at index 74 to have a value of 6. That sped things up.

Now the last thing is to fix the PopUpButton that you helped me with yesterday.

Tahnks!

-Lars
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.