Thursday, January 7, 2016

Day 170: FCC, Basic Algorithm Scripting, Caesar's Cipher Problem

I'm starting today by working on the last piece of FCC that was added during the recent updates, to sections that I had already completed, leaving gaps in my coursework.  Yesterday I completed many JavaScript problems, bringing the JavaScript Basics section to 100% complete once more (I had already completed it, but new coursework was added by FCC, so to maintain my 100% completion status for that section, I had to complete the additional coursework).

Today I'm working on the last problem that was added to the coursework I had already completed, this one to the Basic Algorithm Scripting section of the coursework, and it's also the toughest problem of all the problems that were added.  Once I complete it, I can move on to the Pomodoro Clock.

So, the problem is called Caesar's Cipher, let's get to it.  Solved it!  Here's the problem:





And here's my solution!

function rot13(str) { // LBH QVQ VG!
  var inputArray = str.split('');
  var newArray = [];
  var alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
  for (var i = 0; i < inputArray.length; i++) {
    for (var j = 0; j < 26; j++) {
      if (inputArray[i] === '!') {
          i += 1;
          newArray.push('!');
        }
      if (inputArray[i] === '.') {
          i += 1;
          newArray.push('.');
        }
      if (inputArray[i] === ' ') {
          i += 1;
          newArray.push(' ');
        }
      if (inputArray[i] === '?') {
          i += 1;
          newArray.push('?');
        }
      if (inputArray[i] === alphabet[j]) {
          newArray.push(alphabet[j + 13]); 
        }   
    }   
  }
  var joinedString = newArray.join('');
  return joinedString;
}

// Change the inputs below to test

rot13("SERR PBQR PNZC");

That was awesome!!!  Woohoo!  All right, so I got my first 45 minutes of code in for the day, heading out to wal-mart to get some picks for my teeth (I got braces a couple of months ago, so I have to have these special picks, okay, too much information, lol).  I'll be back in a bit, I'm going to savor my early morning victory and move on to the Pomodoro Project!

O.k., it looks like the curriculum update changed the order of the Front End projects, now the Calculator Project is ahead of the Pomodoro project.  Well, I really want to finish the curriculum in order, I'm trusting that the creators of FCC put each item in the order that they put it in for a reason, so I'll go ahead and do the Calculator Project first, then.

SUMMARY OF CODING SKILLS

Total Treehouse Points: 5,503

Treehouse Points by Subject Matter (Miscellaneous not included): 
HTML:                                663 
CSS:                                1,599 
Design:                            1,193 
Development Tools:            747 
JavaScript:                      1,239

Treehouse Ranking (%): "You have more total points than 93% of all students."

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)
Console Foundations
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
Completed: "A Smarter Way to Learn JavaScript," by Mark Myers 
Completed: "HTML and CSS," by Jon Duckett
Completed: "JavaScript and JQuery," by Jon Duckett

My Progress on The Odin Project:
1.  Introduction to Web Development                                             100% Complete
2.  Web Development 101                                                               33% Complete 
Note: I switched to FCC for the great online community and better updates/support.

My Progress on Free Code Camp (FCC): 
1. Get Started with Free Code Camp                                                      Complete
2. HTML5 and CSS                                                                                  Complete
3. Responsive Design with Bootstrap                                                       Complete
4. Gear up for Success                                                                           Complete
5. jQuery                                                                                              Complete
6. Basic JavaScript                                                                                 Complete
7. Object Oriented and Functional Programming                                     Complete
8. Basic Algorithm Scripting                                                                   Complete
9. Basic Front End Development Projects                                                 On 4 of 5
10. Intermediate Algorithm Scripting                 On 4 of 21 (#13 and #14 also done)

11. JSON API's and Ajax
12. 
Intermediate Front End Development Projects
13. Claim Your Front End Development Certificate
14. Upper Intermediate Algorithm Scripting
15. Automated Testing and Debugging
16. Advanced Algorithm Scripting
17. AngularJS
18. Git
19. Node.js and Express.js
20. MongoDB
21. Full Stack JavaScript Projects

22. Claim Your Full Stack Development Certificate

After the 800 hours of FCC work above, there are 800 more hours of non-profit coding projects.


Hours Spent Coding Today: 1
Total Hours Coding: 795

No comments:

Post a Comment