While there is conceivably gads to learn just in programming Karel to do assignments, or invent problems to solve with the simply robot, the goal is to learn Java itself. At Stanford the class leaves Karel behind after the first week, and the class moves pretty fast. Last week I got interested in extending Karel, almost cheating by using more advanced solutions than called for and exploring things in Karel that aren’t covered in class, like her paint methods.
At the same time, I want to continue learning at the speed of the class or if possible, faster. I’ve done Java before, so much of this I’ve seen before. I would say thus far I have gained in some experience solving more problems in the assignments than I did when I originally set out to learn Java almost twenty years ago more than learn anything. At lecture 7, I’ve still not seen anything truly new for me. Going through the lectures certainly helps clarify and clear memory cobwebs from the first go around.
While going through lecture 7, I know that very soon I’m going to bump into things that I may have seen before which perplexed me and was never used. That is the true value for me taking new stuff that hearkens old stuff I learned a long time ago. I am wiser, if not smarter today than I’ve ever been. My life experience lets me review materials that I’ve gone over before given new light from learning outside the discipline of programming. This is easily explained by something from somewhere else.
There is a great analogy about filling a big jar with pebbles, one at a time. This instance of the analogy might not be perfect, it’s simply how I think of it. When you want to go fast, you want to avoid grains of sand and start with bigger pebbles the size of the biggest rocks that fit. You’ll filling as much space as possible. You’re also not filling as much space as you could with sand. When you can only go one pebble at a time, start with the big stuff and eventually you will only have enough room for small pebbles and sand.
If what I know about programming is silo’d into a metaphorical jar, twenty years ago I got the big rocks in and largely filled programming Java. I knew generally how Java worked to do things, what some of its limitations were and where it would be extremely useful. The learning long ago informed my thinking around the Search Return Sidecar. The big concept is write once, run anywhere, including applet implementations that live client-side on the browser. It’s a truly platform independent software programming language. Now it’s time for me to work on filling the rest of my jar. There’s a terrible pun there, if you see it.
Looking for shortcuts in the programming assignments for Karel the Robot taking Stanford’s CS106A online. The instructor knows Karel doesn’t have full functionality of the Java language but a good portion of them. They also intentionally offer two versions of the class: Karel and SuperKarel. I’ll jump ahead.
The class and instructor move as quickly as possible through the material, so sometimes there are things which should be forgiven. In my case, I came to the class having some experience almost twenty years ago programming Java and I can’t help but remember what I learned. In the instructor’s case, there is one small error I noticed that flies by and no one seems to catch it.
It doesn’t matter either way, as long as I get the value from the class material I’m going through in order to better prepare my capability to take Sidecar 2.0 to the next level. Karel the Robot doesn’t turn around, or turn right in order to teach us to program those methods. In the case of the instructor teaching us to program a method for turning left three times for turn right, he said 6 lefts turns would do the same thing.
That’s not true. It would take seven left turns for Karel to have rotated to the effect of ultimately turning right. No big deal right? Well when I was going through to complete the code assignments for class, I realized after looking at the solutions that I was cheating with Karel the Robot. After a class where I was reminded how to use the ‘for’ loop for counting, I used it for assignments that involved counting.
When the class solutions were revealed, often I realized that I missed the concept of the instruction by way of my cheating using counting. For example, I was to drop a ‘beeper’ in the middle of a street. I simply counted steps to the end of the street using a ‘for’ loop for the move() method, divided by two, turned around and used the count variable to walk halfway back, dropping the beeper. If only I could do that with my taxes 🙂
One of the things you’ll find taking CS106A at Stanford online, is that the version of Eclipse Stanford uses for teaching the course comes with Karel the Robot. You can probably figure out how to get it to work in any version of Eclipse, or run Karel the Robot in any Java IDE but I learned a valuable lesson trying to do this that to save time, I should just stick to the program as set out by the school.
I’m such a rebel. So I want to create my own worlds for Karel just so I know how. The interface is clunky but works fine. You can click and drop construction items like walls and beepers and you can define dimensions. What I liked about looking at world files is that I can do a lot of this in text and skip the interface altogether. The advantages are I don’t have to fight with the clunky click-drag actions on my touchpad.
The things to be aware of is that you still load worlds but can use the file browser to go find worlds you’ve built somewhere in your filesystem. Keeping everything relative to the path where your program resides can save you time navigating. Just remember to name new files the the dot ‘w’ extension, as in filename.w, and Karel the Robot can load your worlds. Be aware of your max 50×50 size limit.
Karel the Robot’s world definitions for Standford CS106A lecture one:
Dimension: (6, 3)
Wall: (4, 1) west
Wall: (4, 1) north
Wall: (5, 1) north
Wall: (6, 1) north
Beeper: (2, 1) 1
Karel: (1, 1) east
You can use the built-in Textedit program on your Mac (or notepad.exe in Windows) to edit this definition file. The best reason I can think of for writing worlds for Karel the Robot is that, not having physically attended the class, the world from the first lecture is not there by default. A blank Karel the Robot starts with a world that has no objects (except the robot in the starting position) and a 10×10 grid. Knowing how to create worlds should help you follow along the way I did.
Last week I decided I would apply myself to revisit being a software engineer more than focus on a career in SEO. I already had a career in SEO and the experience left me with the knowledge as part of my DNA. I am keenly aware how important developers who know about SEO are, and how mixed their skills are. At least with me, I can be confident the SEO instruction set is as simple for me as playing with Legos.
For building more complex systems, I’ve dabbled in SSI and created my own CMS systems, relying only on WordPress for learning how to code custom plugins and themes for SEO clients. I am much more interested in new frameworks like Twitter Bootstrap with Ruby on Rails for my own sites moving forward, and as the backbone of how Sidecar 2.0 works. Search Return is going to be a house that is built with Gems.
In anticipation that I jump in on a summer of code, I’ve needed to install Eclipse.