O.k., back at it, I started the day by reading a long blog post by a google employee about SOA, then watched the SOA video I watched yesterday again. Now, moving on to Chapter 20, "Characteristics of Good Systems."
After reading that chapter, which went over the ideal characteristics of modular systems, I moved on to Chapter 21, "SOLID Design principles." This is great, i'm one chapter away now from the module project, and once I'm done with that, there will only be one more module left before I take the test.
Here's the components of the SOLID acronym:
Finished that chapter, now I'm moving on to Chapter 22, "Pseudocoding Modular Design." I'm so close to completing the module!
O.k., so for chapter 22, our assignment is to write up an elevator program by working with pseudocode, with a focus on breaking code into modules.
I ended up working on the elevator problem for about 9 hours on and off over the past week and came up with many different versions, but none of them were really fully functional, due to the problem of setting up some kind of queue to hold floor pick-up requests and floor drop-off requests. Here are my notes, I did so much more, but ended up deleting and rewriting code many, many times:
PROGRAM Elevator:
IF (up or down call button is pressed)
IF (elevator is stopped on that floor)
THEN OpenElevatorDoor;
THEN DestinationFloor;
IF (elevator is not stopped on that floor)
THEN go full speed to that floor, and SlowDownIfNecessary
IF (elevator is moving OR stopped between floors)
THEN do not open elevator door;
END
THEN OpenElevatorDoor;
THEN DestinationFloor;
ELSE stay in idle mode;
END
PROGRAM SlowDownIfNecessary:
IF (we are traveling up at full speed)
IF (we are only 1 floor away from the lowest destination floor OR there is a pending destination floor in the destination floor queue one floor away or more that has been pressed between the current floor and the destination floor going in the same direction the elevator is going)
THEN slow down;
END
ELSE IF (we are traveling down at full speed)
IF (we are only 1 floor away from the highest destination floor OR there is a call button 1 floor away or more that has been pressed between the current floor and the destination floor going in the same direction the elevator is going)
THEN slow down;
END
END
END
PROGRAM OpenElevatorDoor:
IF (the elevator is stopped at the destination floor OR stopped at a floor on the way to the destination floor)
THEN open elevator door;
THEN wait 30 seconds;
While (there is a human in the door closing path)
THEN open elevator door;
THEN close elevator door;
PROGRAM DestinationFloor:
READ destination floor in queue;
IF (user selects a destination floor that is higher than the current floor)
THEN go up full speed to that floor and SlowDownIfNecessary
IF (elevator is moving OR stopped between floors)
THEN do not open elevator door;
ELSE IF (elevator is currently stopped at the destination floor)
THEN OpenElevatorDoor;
ELSE IF (user selects a destination floor that is lower than the current floor)
THEN go down full speed to that floor and SlowDownIfNecessary;
IF (elevator is moving OR stopped between floors)
THEN do not open elevator door;
ELSE IF (elevator is currently stopped at the destination floor)
THEN OpenElevatorDoor;
ELSE (OpenElevatorDoor)
END
PROGRAM FloorQueue (very rough draft)
IF (a up or down call button is pressed OR a floor button inside the elevator is pressed)
THEN add a destination floor in a queue corresponding to the button pressed;
WHILE (there are destination floors in the queue)
THEN keep going until there are no destination floors left in the queue;
IF (the elevator stops at a floor)
THEN remove any matching destination floor(s) from the queue;
I could keep working on the elevator problem, and then work on the project for the module, but the thing is, I received an email from the Viking Code School yesterday letting me know that my application will be deleted if I don't let them know that I am still working on things. So, I let them know to keep my application active, because I am still working on the pre work, but in order to get to actual Ruby code as soon as possible, which I need to know in order to take the exam, I'm moving on ahead to the next module.
I did get a ton of practice pseudocoding, though, because I worked on that elevator problem for what seemed like forever. The notes I posted are just a small part of all the variations I went through while working on it, so I did find this chapter extremely helpful, even if I am not posting a fully functional elevator. That said, posting a fully functional elevator wasn't actually the assignment (there are entire books on this), but rather, the assignment was to work with breaking code up into modules, and that I did many times as I went through different iterations of my attempt at an elevator program.
O.k., I read through chapters 23, 24, 25, AND 26, and now I'm moving on to the final module. I'm thinking once I learn Ruby I'll come back to the elevator problem and try it again, armed with more coding concepts! :)
SUMMARY OF CODING SKILLS
After reading that chapter, which went over the ideal characteristics of modular systems, I moved on to Chapter 21, "SOLID Design principles." This is great, i'm one chapter away now from the module project, and once I'm done with that, there will only be one more module left before I take the test.
Here's the components of the SOLID acronym:
Finished that chapter, now I'm moving on to Chapter 22, "Pseudocoding Modular Design." I'm so close to completing the module!
O.k., so for chapter 22, our assignment is to write up an elevator program by working with pseudocode, with a focus on breaking code into modules.
I ended up working on the elevator problem for about 9 hours on and off over the past week and came up with many different versions, but none of them were really fully functional, due to the problem of setting up some kind of queue to hold floor pick-up requests and floor drop-off requests. Here are my notes, I did so much more, but ended up deleting and rewriting code many, many times:
PROGRAM Elevator:
IF (up or down call button is pressed)
IF (elevator is stopped on that floor)
THEN OpenElevatorDoor;
THEN DestinationFloor;
IF (elevator is not stopped on that floor)
THEN go full speed to that floor, and SlowDownIfNecessary
IF (elevator is moving OR stopped between floors)
THEN do not open elevator door;
END
THEN OpenElevatorDoor;
THEN DestinationFloor;
ELSE stay in idle mode;
END
PROGRAM SlowDownIfNecessary:
IF (we are traveling up at full speed)
IF (we are only 1 floor away from the lowest destination floor OR there is a pending destination floor in the destination floor queue one floor away or more that has been pressed between the current floor and the destination floor going in the same direction the elevator is going)
THEN slow down;
END
ELSE IF (we are traveling down at full speed)
IF (we are only 1 floor away from the highest destination floor OR there is a call button 1 floor away or more that has been pressed between the current floor and the destination floor going in the same direction the elevator is going)
THEN slow down;
END
END
END
PROGRAM OpenElevatorDoor:
IF (the elevator is stopped at the destination floor OR stopped at a floor on the way to the destination floor)
THEN open elevator door;
THEN wait 30 seconds;
While (there is a human in the door closing path)
THEN open elevator door;
THEN close elevator door;
PROGRAM DestinationFloor:
READ destination floor in queue;
IF (user selects a destination floor that is higher than the current floor)
THEN go up full speed to that floor and SlowDownIfNecessary
IF (elevator is moving OR stopped between floors)
THEN do not open elevator door;
ELSE IF (elevator is currently stopped at the destination floor)
THEN OpenElevatorDoor;
ELSE IF (user selects a destination floor that is lower than the current floor)
THEN go down full speed to that floor and SlowDownIfNecessary;
IF (elevator is moving OR stopped between floors)
THEN do not open elevator door;
ELSE IF (elevator is currently stopped at the destination floor)
THEN OpenElevatorDoor;
ELSE (OpenElevatorDoor)
END
PROGRAM FloorQueue (very rough draft)
IF (a up or down call button is pressed OR a floor button inside the elevator is pressed)
THEN add a destination floor in a queue corresponding to the button pressed;
WHILE (there are destination floors in the queue)
THEN keep going until there are no destination floors left in the queue;
IF (the elevator stops at a floor)
THEN remove any matching destination floor(s) from the queue;
I could keep working on the elevator problem, and then work on the project for the module, but the thing is, I received an email from the Viking Code School yesterday letting me know that my application will be deleted if I don't let them know that I am still working on things. So, I let them know to keep my application active, because I am still working on the pre work, but in order to get to actual Ruby code as soon as possible, which I need to know in order to take the exam, I'm moving on ahead to the next module.
I did get a ton of practice pseudocoding, though, because I worked on that elevator problem for what seemed like forever. The notes I posted are just a small part of all the variations I went through while working on it, so I did find this chapter extremely helpful, even if I am not posting a fully functional elevator. That said, posting a fully functional elevator wasn't actually the assignment (there are entire books on this), but rather, the assignment was to work with breaking code up into modules, and that I did many times as I went through different iterations of my attempt at an elevator program.
O.k., I read through chapters 23, 24, 25, AND 26, and now I'm moving on to the final module. I'm thinking once I learn Ruby I'll come back to the elevator problem and try it again, armed with more coding concepts! :)
SUMMARY OF CODING SKILLS
Total Treehouse Points: 5,385
Treehouse Points by Subject Matter (Miscellaneous not included):
HTML: 663
CSS: 1,599
Design: 1,193
Development Tools: 747
Javascript: 1,120
Treehouse Ranking (%): "You have more total points than 94% of all students."
Treehouse Badge(s) Earned Today:
Treehouse Courses Completed:
How to Make a Website
HTML
CSS Foundations
CSS Layout Techniques
Aesthetic Foundations
Design Foundations
Adobe Photoshop Foundations
Adobe Illustrator Foundations (66% complete, switched focus from web design to web dev)
Git Basics
Introduction to Programming
Javascript Basics
Codecademy (& other) Courses Completed:
HTML and CSS (Codecademy)
Design Foundations
Adobe Photoshop Foundations
Adobe Illustrator Foundations (66% complete, switched focus from web design to web dev)
Git Basics
Introduction to Programming
Javascript Basics
Codecademy (& other) Courses Completed:
HTML and CSS (Codecademy)
Books Read or in Progress:
Completed: "Head First HTML and CSS," by E. Robson & E. Freeman
In Progress: "Eloquent JavaScript," by Marijn Haverbeke (On pg 27)
In Progress: "Head First Javascript," by Eric Freeman and Elisabeth Robson (On pg 56)
In Progress: "A Smarter Way to Learn Javascript," by Mark Myers (on pg 72)
My Progress on The Odin Project:
1. Introduction to Web Development 100% Complete
2. Web Development 101 29% Complete
3. Ruby Programming 0% Complete
4. Ruby on Rails 0% Complete
5. HTML5 and CSS3 0% Complete
6. Javascript and JQuery 0% Complete
7. Getting Hired as a Web Developer 0% Complete
Hours Spent Coding Over the Past Week:1 1
Total Hours Coding: 538
No comments:
Post a Comment