Using the Java Library
Today, in chapter 6 of Head First Java, we are upgrading yesterday's simple version of the DotCom game from a 7-cell/1 dotcom company to a 7 by 7 grid with 3 dotcom companies.
This is a computer automated version of Battleship where the computer randomly sets the three dotcom companies within the grid and the user has to guess where they are. This is still played at the command line and is rather primitive but it's a good learning tool.
I'm surprising myself; as I slowly traverse through the book I understand more of the code. I really did wonder if I was ever going to understand this stuff. It makes me happy to know that I am STILL CAPABLE of learning difficult material. It gives me hope that I'll be able to be competitive in graduate school even if java programming requires a vastly different skill set than acupuncture and Oriental medicine.
This chapter explains the arraylist which is so much "smarter" than regular arrays. The arraylist grows and shrinks as objects are added or removed, you can declare and create specific types of objects, you can just "ask" it if it holds a certain object rather than have to loop through each cell, and many other "things" it can do that I haven't learned yet.
We learn new boolean expressions (those are the yes/no type of expressions) And, Or, Not, and NotEquals.
Most important of all, we learn how to look up libraries of java utilities that are pre-written and can be used anytime simply by including an import at the top of your code. So much code is Already Written for me! Woo hoo!
Short post today. Most of my practice time was spent debugging my game. Debugging code is an important skill to learn. Surely I'll get faster as time goes by.
Tomorrow, besides another java post, I think I'll add a new recipe to this blog. Unlike programming, almost everyone is interested in food...
This is a computer automated version of Battleship where the computer randomly sets the three dotcom companies within the grid and the user has to guess where they are. This is still played at the command line and is rather primitive but it's a good learning tool.
I'm surprising myself; as I slowly traverse through the book I understand more of the code. I really did wonder if I was ever going to understand this stuff. It makes me happy to know that I am STILL CAPABLE of learning difficult material. It gives me hope that I'll be able to be competitive in graduate school even if java programming requires a vastly different skill set than acupuncture and Oriental medicine.
This chapter explains the arraylist which is so much "smarter" than regular arrays. The arraylist grows and shrinks as objects are added or removed, you can declare and create specific types of objects, you can just "ask" it if it holds a certain object rather than have to loop through each cell, and many other "things" it can do that I haven't learned yet.
We learn new boolean expressions (those are the yes/no type of expressions) And, Or, Not, and NotEquals.
Most important of all, we learn how to look up libraries of java utilities that are pre-written and can be used anytime simply by including an import
Short post today. Most of my practice time was spent debugging my game. Debugging code is an important skill to learn. Surely I'll get faster as time goes by.
Tomorrow, besides another java post, I think I'll add a new recipe to this blog. Unlike programming, almost everyone is interested in food...
0 comments:
Post a Comment