(2d-c# basic, Number Wizard, Calculate Guess Variable)

Okay, here’s my question:

At 6:44 in the video, you put max = 1000 +1 in the void Update() area so the up arrow would make it all the way to 1000 to fix an error/bug. It was placed in void Update().

Why was it put in void and not in public class such as int max = 1000+1

Both places work the same when I run the code.

So why void Update () vs public class?

Thanks, Jenn

I solved this myself. I feel so dumb.

So I’m thinking about this and it hit me. Why would anyone put int max = 1000 + 1 ??? lol… omg. The answer is 1001 and that is NOT the max. The max is 1000. hahahaha

int max = 1000 + 1 does not even make sense. int max = 1000 is just the declaration/initialization of max.

max = max = 1. That makes sense. And this statement does not go in public class.

Okay… Moving on…

Jenn

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms