TrackBack URL for this entry: http://www.collisiondetection.net/mt3/mt-tb.cgi/552
I can't find it now but I remember that one of the top competitive games when I was in college among the CS set was one where you had to convert decimal numbers to binary in a very limited amount of time.
I think a high score list makes any game that much more fun.
Posted by: Jeff Liu at October 28, 2003 5:43 PM
How fast were you at that game?
Posted by: Clive at October 29, 2003 12:08 PM
Posted by: Jeff Liu at October 29, 2003 5:22 PM
Posted by: Online Casino at January 16, 2004 4:21 PM
Let's take a moment to reexamine that. What we've done here is create two variables. The first variable is in the Heap, and we're storing data in it. That's the obvious one. But the second variable is a pointer to the first one, and it exists on the Stack. This variable is the one that's really called favoriteNumber, and it's the one we're working with. It is important to remember that there are now two parts to our simple variable, one of which exists in each world. This kind of division is common is C, but omnipresent in Cocoa. When you start making objects, Cocoa makes them all in the Heap because the Stack isn't big enough to hold them. In Cocoa, you deal with objects through pointers everywhere and are actually forbidden from dealing with them directly.
Posted by: Randall at January 19, 2004 7:55 PM
Each Stack Frame represents a function. The bottom frame is always the main function, and the frames above it are the other functions that main calls. At any given time, the stack can show you the path your code has taken to get to where it is. The top frame represents the function the code is currently executing, and the frame below it is the function that called the current function, and the frame below that represents the function that called the function that called the current function, and so on all the way down to main, which is the starting point of any C program.
Posted by: Francis at January 19, 2004 7:55 PM
This is another function provided for dealing with the heap. After you've created some space in the Heap, it's yours until you let go of it. When your program is done using it, you have to explicitly tell the computer that you don't need it anymore or the computer will save it for your future use (or until your program quits, when it knows you won't be needing the memory anymore). The call to simply tells the computer that you had this space, but you're done and the memory can be freed for use by something else later on.
Posted by: Matilda at January 19, 2004 7:55 PM
But variables get one benefit people do not
Posted by: Annanias at January 19, 2004 7:55 PM
Being able to understand that basic idea opens up a vast amount of power that can be used and abused, and we're going to look at a few of the better ways to deal with it in this article.
Posted by: Isaac at January 19, 2004 7:55 PM
We can see an example of this in our code we've written so far. In each function's block, we declare variables that hold our data. When each function ends, the variables within are disposed of, and the space they were using is given back to the computer to use. The variables live in the blocks of conditionals and loops we write, but they don't cascade into functions we call, because those aren't sub-blocks, but different sections of code entirely. Every variable we've written has a well-defined lifetime of one function.
Posted by: Dionise at January 19, 2004 7:55 PM
That gives us a pretty good starting point to understand a lot more about variables, and that's what we'll be examining next lesson. Those new variable types I promised last lesson will finally make an appearance, and we'll examine a few concepts that we'll use to organize our data into more meaningful structures, a sort of precursor to the objects that Cocoa works with. And we'll delve a little bit more into the fun things we can do by looking at those ever-present bits in a few new ways.
Posted by: Randolph at January 19, 2004 7:55 PM
This code should compile and run just fine, and you should see no changes in how the program works. So why did we do all of that?
Posted by: Roger at January 19, 2004 7:55 PM
We can see an example of this in our code we've written so far. In each function's block, we declare variables that hold our data. When each function ends, the variables within are disposed of, and the space they were using is given back to the computer to use. The variables live in the blocks of conditionals and loops we write, but they don't cascade into functions we call, because those aren't sub-blocks, but different sections of code entirely. Every variable we've written has a well-defined lifetime of one function.
Posted by: Heneage at January 19, 2004 7:55 PM
Note the new asterisks whenever we reference favoriteNumber, except for that new line right before the return.
Posted by: Daniel at January 19, 2004 7:55 PM
Posted by: julia at January 24, 2004 8:16 PM
Posted by: Clive at January 24, 2005 4:23 PM
I can't find it now but I remember that one of the top competitive games when I was in college among the CS set was one where you had to convert decimal numbers to binary in a very limited amount of time.
I think a high score list makes any game that much more fun.
Posted by: Jeff Liu at October 28, 2003 5:43 PM
How fast were you at that game?
Posted by: Clive at October 29, 2003 12:08 PM
Not very.
Posted by: Jeff Liu at October 29, 2003 5:22 PM
Nice site. thx.
Posted by: Online Casino at January 16, 2004 4:21 PM
Let's take a moment to reexamine that. What we've done here is create two variables. The first variable is in the Heap, and we're storing data in it. That's the obvious one. But the second variable is a pointer to the first one, and it exists on the Stack. This variable is the one that's really called favoriteNumber, and it's the one we're working with. It is important to remember that there are now two parts to our simple variable, one of which exists in each world. This kind of division is common is C, but omnipresent in Cocoa. When you start making objects, Cocoa makes them all in the Heap because the Stack isn't big enough to hold them. In Cocoa, you deal with objects through pointers everywhere and are actually forbidden from dealing with them directly.
Posted by: Randall at January 19, 2004 7:55 PM
Each Stack Frame represents a function. The bottom frame is always the main function, and the frames above it are the other functions that main calls. At any given time, the stack can show you the path your code has taken to get to where it is. The top frame represents the function the code is currently executing, and the frame below it is the function that called the current function, and the frame below that represents the function that called the function that called the current function, and so on all the way down to main, which is the starting point of any C program.
Posted by: Francis at January 19, 2004 7:55 PM
This is another function provided for dealing with the heap. After you've created some space in the Heap, it's yours until you let go of it. When your program is done using it, you have to explicitly tell the computer that you don't need it anymore or the computer will save it for your future use (or until your program quits, when it knows you won't be needing the memory anymore). The call to simply tells the computer that you had this space, but you're done and the memory can be freed for use by something else later on.
Posted by: Matilda at January 19, 2004 7:55 PM
But variables get one benefit people do not
Posted by: Annanias at January 19, 2004 7:55 PM
Being able to understand that basic idea opens up a vast amount of power that can be used and abused, and we're going to look at a few of the better ways to deal with it in this article.
Posted by: Isaac at January 19, 2004 7:55 PM
We can see an example of this in our code we've written so far. In each function's block, we declare variables that hold our data. When each function ends, the variables within are disposed of, and the space they were using is given back to the computer to use. The variables live in the blocks of conditionals and loops we write, but they don't cascade into functions we call, because those aren't sub-blocks, but different sections of code entirely. Every variable we've written has a well-defined lifetime of one function.
Posted by: Dionise at January 19, 2004 7:55 PM
That gives us a pretty good starting point to understand a lot more about variables, and that's what we'll be examining next lesson. Those new variable types I promised last lesson will finally make an appearance, and we'll examine a few concepts that we'll use to organize our data into more meaningful structures, a sort of precursor to the objects that Cocoa works with. And we'll delve a little bit more into the fun things we can do by looking at those ever-present bits in a few new ways.
Posted by: Randolph at January 19, 2004 7:55 PM
This code should compile and run just fine, and you should see no changes in how the program works. So why did we do all of that?
Posted by: Roger at January 19, 2004 7:55 PM
We can see an example of this in our code we've written so far. In each function's block, we declare variables that hold our data. When each function ends, the variables within are disposed of, and the space they were using is given back to the computer to use. The variables live in the blocks of conditionals and loops we write, but they don't cascade into functions we call, because those aren't sub-blocks, but different sections of code entirely. Every variable we've written has a well-defined lifetime of one function.
Posted by: Heneage at January 19, 2004 7:55 PM
Note the new asterisks whenever we reference favoriteNumber, except for that new line right before the return.
Posted by: Daniel at January 19, 2004 7:55 PM
Posted by: julia at January 24, 2004 8:16 PM
electrolicious.com
Posted by: Clive at January 24, 2005 4:23 PM