A Pen by Christonja on CodePen.
Arrays exercise on web dev bootcamp by Colt Steele, all my own solutions.
/*JavaScript Algorithms and Data Structures Projects: Roman Numeral Converter: | |
Challenge designed by FreeCodeCamp, solution derived from learning obtained thanks to FreeCodeCamp and | |
with some assistance from other people's solutions on the internet. I'm not willing to take ownership of | |
the below code beyond that I was on the right track. ie. what is inside the while loop was my own solution. | |
Function calls provided by FreeCodeCamp as ways to test the algorithm*/ | |
function convertToRoman(num) { | |
//Two array of the same length accounting for roman numerals and decimal values those roman numerals represent. | |
var startingNum = num; | |
var decimal = [ 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 ]; |
/* JavaScript Algorithms and Data Structures Projects: Caesars Cipher: | |
Challenge designed by FreeCodeCamp, solution derived completely from my learning obtained thanks to FreeCodeCamp | |
and other sources on the internet, notably W3Schools.com, function calls provided by FreeCodeCamp as ways to | |
test the algorithm */ | |
function rot13(str) { | |
var regex = /[A-Z]/; | |
var newStr = ""; | |
var char; | |
//Cycle through the original string |
/*JavaScript Algorithms and Data Structures Projects: Palindrome Checker: | |
Challenge designed by FreeCodeCamp, solution derived completely from my learning obtained | |
thanks to FreeCodeCamp and other sources on the internet, notably W3Schools.com, function calls | |
provided by FreeCodeCamp as ways to test the algorithm*/ | |
function palindrome(str) { | |
// Good luck! | |
//Create a new regexp for checking for alphanumeric characters in string | |
var regexp = /[0-9a-zA-Z]+/g; |
A Pen by Christonja on CodePen.
Arrays exercise on web dev bootcamp by Colt Steele, all my own solutions.